public static function run() { require_once 'library/Smarty/Smarty.class.php'; require_once 'core/Loader.class.php'; date_default_timezone_set("Asia/Shanghai"); Loader::init(); Factory::run(); }
/** Basic initialization - preload settings and locales * @return void */ public static function basic() { Loader::init(); Status::init(); Settings::init(); Locales::init(); Router::update_rewrite(); }
/** * App init * @access public * @static */ public static function init() { self::importCore(); ProjectConfiguration::init(); date_default_timezone_set(ProjectConfiguration::getConfig('timezone')); self::initLog(); set_error_handler('App::errorHandler', ProjectConfiguration::getConfig('error_level')); Loader::init(); self::$mControllerAndParams = Loader::getControllerFromUrlObject(); self::$mTemplateObj = PHPTemplate::getInstance(); }
/** * 类不存在 * * @expectedException Exception * @expectedExceptionMessage the class "ClassNotExist" is not found */ public function testClassNotExist() { Loader::init(array('Library/'), array('.class.php')); $cl = new ClassNotExist(); }
fwrite($file, file_get_contents($frameworks[$framework][0])); fclose($file); echo "\n" . $frameworks[$framework][1] . " has been added!\n\n"; // List the JS frameworks } elseif ($framework == 'list') { echo "\n"; $output = ''; foreach ($frameworks as $name => $data) { $output .= $name . '|'; } $output = rtrim($output, '|'); return '[' . $output . ']'; // Framework was not found } else { echo "\nInvalid javascript framework.\nPlease use one from below.\n./script/load javascript " . self::javascript('list') . "\n\n"; } } private static function url($location) { switch ($location) { case 'javascripts': return BASE_PATH . '/../public/javascripts'; break; default: return false; break; } } } Loader::init();
<?php include 'config.php'; include 'loader.php'; include 'api.php'; include 'database.php'; include 'message.php'; include 'json.php'; $loader = new Loader(); $loader->init();