/** * Remember to call parent::init() first when you override this! * */ public function init() { $this->args = new SimpleArgs(); if (!$this->args->getCount() || $this->args->flag('help')) { $this->showHelp(); exit; } $coreApp = $this->getOption('app', DEFAULT_APP); $coreEnv = $this->getOption('env', DEFAULT_ENV); // Bootstrap framework define('CORE_APP', $coreApp); define('CORE_ENVIRONMENT', $coreEnv); define('CORE_DEBUG', true); require_once CORE_ROOT_DIR . '/apps/' . CORE_APP . '/config/config.php'; $configurationClass = CORE_APP . 'Configuration'; $configuration = new $configurationClass(CORE_ENVIRONMENT, CORE_DEBUG, CORE_ROOT_DIR); coreContext::createInstance($configuration); $this->isVerbose = $this->args->flag('v') !== false; $this->verbose("Verbose: ON (CORE_APP '%s', CORE_ENVIRONMENT '%s')", CORE_APP, CORE_ENVIRONMENT); }
<?php define('CORE_ROOT_DIR', realpath(dirname(__FILE__) . '/..')); define('CORE_APP', 'revtk'); define('CORE_ENVIRONMENT', 'dev'); define('CORE_DEBUG', true); require_once CORE_ROOT_DIR . '/apps/' . CORE_APP . '/config/config.php'; $configuration = new revtkConfiguration(CORE_ENVIRONMENT, CORE_DEBUG, CORE_ROOT_DIR); coreContext::createInstance($configuration); coreContext::getInstance()->getController()->dispatch();