public static function StartApp() { ob_start('ob_gzhandler'); session_start(); // Defines define('BASEURL', substr((empty($_SERVER['HTTPS']) ? 'http://' : 'https://' ) . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'],0,-10)); define('BASEPATH', substr($_SERVER['SCRIPT_FILENAME'],0,-10)); // Helper Boot Loader require(BASEPATH.'/core/bootloader.php'); // Initialize Helpers BootLoader::loadHelpers(); Registry::getInstance(); // Handle Errors Registry::setDebugMode(true); set_error_handler('Template::handleError'); set_exception_handler('Template::handleException'); // Initialize Database Model::$db = DBO::getInstance('sqlite:example.sqldb'); // Init Autoloads spl_autoload_register('Autoload::controllers'); spl_autoload_register('Autoload::models'); // Determine Controllers and Methods Routes::getRoute(); // Run Application Routes::run(); }
} if (DB_USER) { $username = DB_USER; } if (DB_PASSWORD) { $password = DB_PASSWORD; } if (DB_HOST) { $host = DB_HOST; } // init the Database ($db) object and connect to the database $db = new $adapter($host, $database, $username, $password); /** * boot the loads */ $loader = new BootLoader(); $loader->start(); if ($db->just_get_objects()) { return; } /** * connect pre-plugin routes */ // doesn't work XXX //$request->connect( 'migrate' ); /** * set up wp theme and plugin paths */ $wp_theme = "wp-content" . DIRECTORY_SEPARATOR . "themes" . DIRECTORY_SEPARATOR . $env['theme']; if (file_exists($wp_theme)) { $GLOBALS['PATH']['content_plugins'] = 'wp-content' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR;
public function testBootLoaderSetsRelativeToPackageFileDirAsDirWhenCreateWithRelative() { $bootLoader = BootLoader::createRelative('../tests/'); $this->assertEquals($this->testsDir, $bootLoader->getPath(NULL, BootLoader::RELATIVE)); }