/**
* This method will be invoked by composer after a successful installation and creates
* the application server configuration file under etc/appserver/appserver.xml.
*
* @param \Composer\Script\Event $event The event that invokes this method
*
* @return void
*/
public static function postInstall(Event $event)
{
// initialize the installation directory
$override = false;
$installDir = getcwd();
// check the arguments for an installation directory
foreach ($event->getArguments() as $arg) {
// extract arguments
list($key, ) = explode('=', $arg);
// query we want to override files
if ($key === SetupKeys::ARG_OVERRIDE) {
$override = true;
}
// query for a custom installation directory
if ($key === SetupKeys::ARG_INSTALL_DIR) {
$installDir = str_replace("{$key}=", '', $arg);
}
}
Setup::prepareContext($installDir, $event);
// process and move the configuration files their target directory
Setup::processTemplate('etc/appserver/appserver.xml', $override);
// write a message to the console
$event->getIo()->write(sprintf('%s<info>Successfully invoked appserver.io Composer post-install-cmd script ...</info>', Setup::$logo));
}