<?php require_once "vendor/autoload.php"; use Kasha\Generator\AppGenerator; //print_r($argv); // if ($argc == 1) { printUsage(); } elseif ($argv[1] == '--help') { printHelp(); } else { $scriptName = array_shift($argv); $commandName = array_shift($argv); switch ($commandName) { case 'create:app': createApp($argv); break; case 'create:module': createModule($argv); break; case 'create:action': createAction($argv); break; default: printUsage(); break; } } function printUsage() { print 'Usage: php generator.php [params]' . PHP_EOL;
* Include main files */ require_once XAPP_BASEDIR . 'commander/Bootstrap.php'; require_once XAPP_BASEDIR . 'commander/App.php'; /** * Bootstrap override */ $XAPP_BOOTSTRAP_OVERRIDE = array(); ///////////////////////////////////////////////////////////////// // // 3. First pass, override config with CONF_DIRECTORY/default.php // ///////////////////////////////////////////////////////////////// $XF_DEFAULT_PROFILE = realpath($CONF_DIRECTORY . DIRECTORY_SEPARATOR . $XF_DEFAULT_PROFILE . '.php'); if (file_exists($XF_DEFAULT_PROFILE)) { require_once $XF_DEFAULT_PROFILE; } ///////////////////////////////////////////////////////////////// // // 4. Second pass, override config with CONF_DIRECTORY/custom.php // ///////////////////////////////////////////////////////////////// $XF_CUSTOM_PROFILE = realpath($CONF_DIRECTORY . DIRECTORY_SEPARATOR . $XF_CUSTOM_PROFILE . '.php'); if (file_exists($XF_CUSTOM_PROFILE)) { require_once $XF_CUSTOM_PROFILE; } $app = createApp($XAPP_SITE_DIRECTORY . DIRECTORY_SEPARATOR . 'xapp' . DIRECTORY_SEPARATOR, 'xbox', $XAPP_SITE_DIRECTORY . DIRECTORY_SEPARATOR . 'client' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR, $XF_PATH, '', $XF_ALLOWED_UPLOAD_EXTENSIONS, json_encode($XF_CONFIG), $XF_THEME, $ROOT_DIRECTORY_ABSOLUTE . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR, $ROOT_DIRECTORY_ABSOLUTE . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . 'settings.json', $XAPP_SALT_KEY, $XF_PROHIBITED_PLUGINS, $XF_RESOURCE_VARIABLES, $XAPP_COMPONENTS, $XAPP_RESOURCE_CONFIG, $XAPP_BOOTSTRAP_OVERRIDE); /** * now punch it Scotty! */ $app['bootstrap']->handleRequest();