Skip to content

MODX Revolution commandline based install helpers. Also possible to hook in your own needs!

Notifications You must be signed in to change notification settings

greyskymedia/MODX-Installers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General MODX Revolution PHP commandline based install tool. With additional options to customize and extend for your own needs.

Install installers

To configure this installers to work:
- copy "includes/config.example.conf" to "includes/config.conf"
- modify values in config.conf for your needs

It's also possible to create template files for the Apache & NginX virtual hosts files. These files should be located in subfolder templates/ and should be named like;

vhs.apache.tpl = The main Apache VirtualHost file
vhs.apache.alias.tpl = The main Apache VirtualHost file !WITH! alias support
vhs.nginx.tpl = The main NginX server block file
vhs.nginx.alias.tpl = The main NginX server block file !WITH! alias support

Commandline examples

- cd /to/your/path/with/the/installers/
- php install-core.php
- php install-packages.php

And if you have any other hooks created;
- php install-any.php

Installer hooks

You can install/create hooks for several purposes. Below a list of possibilities to hook in; Note: all hooks are stored into the hooks/ folder.

OVERALL

Anywhere you can use a readQuestion() method to 'ask' things commandline based. Usage:

$bool = readQuestion('This is a basic YES/NO question and returns boolean true or false');
$str = readQuestion('This way you can ask to input something', 'any');

INSTALL CORE

You can hook in at the end of the CORE installer, create PHP files that are prefixed with "install-core." and always ends with ".php"

For example; When you want to create some extra assets folders, you can add a file inside hooks/ like:

install-core.CreateAssets.php This script can create the directories you want to create.

Available variables here;
- $projecthost = Hostname of the project
- $projectalis = Alternate alias hostname of the project
- $projectpath = The absolute path the projects root folder
- $adminUser = The MODX admin username
- $adminPassword = The MODX admin password
- $adminEmail = The MODX admin emailaddress

INSTALL PACKAGES

You can hook in at the end of the packages installer. Create PHP files that are prefixed with "install-packages." and always ends with ".php"

For example; The package installer asks to install a couple of package, but maybe you want to install some defaults your own.. You can do that with a hook!

install-packages.MyPackages.php

Available variables here;
- $modx = The well known MODX instance
- $projectpath = The absolute path the projects root folder
- $defaultProvider = The default MODX core package provider
- $productVersion = The version of your installed MODX

Available methods here;

downloadAndInstallPackage(
    $packageName, /* The name of the package to install, like "getResources" */
    $installOptions, /* Extra options like a custom provider setting. In the future setup options will be supported too! */
);

It will return true or false if install is successful

INSTALL ANYTHING ELSE!

For everything else you want to install inside your project, you can create your own hooks to load when running this installer.

For example; If you always have the same MODX elements (such as categories, chunks, templates etc.), you can create a or multiple hooks to install that elements for you all the time.

Available variables here;
- $modx = The well known MODX instance
- $projectpath = The absolute path the projects root folder

About

MODX Revolution commandline based install helpers. Also possible to hook in your own needs!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published