The init function is called prior to the execution of every install and upgrade and registers commands for later execution.
A registerArchive call registers an archive that may or may not be extracted later.
$this->registerArchive("id", "url", "archive_type", "md5_checksum");
id is a unique id, typically within the A-Za-z0-9_ character set, for the archive being registered.
url is the URL to the archive.
archive_type is the type of archive and can be "tar", "tar.gz" or "zip". No other types are currently supported.
md5_checksum is the md5 checksum of the archive. This field is optional.
A registerCustomCode call registers code to be executed at a specified hook during the install and/or upgrade processes.
$this->registerCustomCode("app", "limit_version", "install_or_upgrade", "hook", "hook2", "function");
app is the ID of the application package the code pertains to.
limit_version defines a specific version the code should be limited to, or if the code applies to all versions, the keyword "all" can be specified.
install_or_upgrade specifies whether the code should be executed for the install or upgrade processes.
hook specifies the location within the install/upgrade process this code should be executed. A value of "last" executes the code at the end (recommended). A value of "1" executes the code before the install/upgrade process has started, when input fields are presented to the client. A value of "2" executes at the beginning.
hook2 provides further accuracy in regards to where the specified code should be executed. Typically, a value of "process" is used. However, a value of "init" should be used when defining input fields.
function specifies the function that contains the code to be executed.
The wordpressinstall($o) function is an example of code that will be executed (if it's registered in the init function). The $o object referenced is an instance of the application package as defined in the package's install.php or upgrade.php file.
All the tools and functions available in the install.php and upgrade.php files are available for use. For a full list of available functions, please reference the Installatron Application Packaging SDK:
Don't hesitate to contact Installatron Support with any questions regarding this system.