本文整理汇总了PHP中Load::loadSetupFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Load::loadSetupFiles方法的具体用法?PHP Load::loadSetupFiles怎么用?PHP Load::loadSetupFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::loadSetupFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Starting point for every page request. Loads required core modules, gets data from url and calls
* necessary modules to make things happen.
*/
public static function init()
{
if (!self::$_inited) {
self::$_inited = true;
foreach (self::$_requiredCore as $module) {
require_once ROOT . 'core/' . $module . '/' . $module . EXT;
}
// Set the Load::auto method to handle all class loading from now on
spl_autoload_register('Load::auto');
Load::loadSetupFiles();
// If CLI mode, everything thats needed has been loaded
if (IS_CLI) {
return;
}
date_default_timezone_set(Config::get('system.timezone'));
Event::trigger('caffeine.started');
// If maintenance mode has been set in the config, stop everything and load mainteance view
if (Config::get('system.maintenance_mode')) {
View::error(ERROR_MAINTENANCE);
} else {
list($route, $data) = Router::getRouteData();
if ($data) {
if (self::_hasPermission($route, $data)) {
list($module, $controller, $method) = $data['callback'];
$params = Router::getParams();
// Make sure controller words are upper-case
$conBits = explode('_', $controller);
foreach ($conBits as &$bit) {
$bit = ucfirst($bit);
}
$controller = implode('_', $conBits);
$controller = sprintf('%s_%sController', ucfirst($module), ucwords($controller));
// Call the routes controller and method
if (method_exists($controller, $method)) {
$response = call_user_func_array(array($controller, $method), $params);
if (!self::_isErrorResponse($response)) {
Event::trigger('module.response', array($response));
View::load($module, $controller, $method);
} else {
View::error($response);
}
} else {
Log::error($module, sprintf('The method %s::%s() called by route %s doesn\'t exist.', $controller, $method, $route));
View::error(ERROR_500);
}
} else {
View::error(ERROR_ACCESSDENIED);
}
} else {
if ($route !== '[index]' || !View::directLoad('index')) {
View::error(ERROR_404);
}
}
}
View::output();
Event::trigger('caffeine.finished');
} else {
die('Why are you trying to re-initialize Caffeine?');
}
}