本文整理汇总了PHP中Autoloader::loadFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoloader::loadFiles方法的具体用法?PHP Autoloader::loadFiles怎么用?PHP Autoloader::loadFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoloader
的用法示例。
在下文中一共展示了Autoloader::loadFiles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor for the evergreen class that sets up all the necessary parts of the framework so it can run.
*
* @access public
*/
public function __construct()
{
$starttime = microtime(true);
try {
// register the autoloaders
Autoloader::register();
// setup error handling
set_error_handler(array("Config", "logError"), ini_get("error_reporting"));
// load the main config.php file
if (file_exists(Reg::get("Path.physical") . '/config/config.php')) {
include_once Reg::get("Path.physical") . '/config/config.php';
} else {
echo "You are missing the configuration file and without it Evergreen cannot run.";
exit;
}
// load the main errors.php file
if (file_exists(Reg::get("Path.physical") . '/config/errors.php')) {
include Reg::get("Path.physical") . '/config/errors.php';
}
// check if the welcome content is present and if it is show it
if (file_exists(Reg::get("Path.physical") . '/public/welcome.php')) {
// Load the welcome content
include Reg::get("Path.physical") . '/public/welcome.php';
exit;
}
// code that is run at the exit of the script
register_shutdown_function(array($this, 'shutdown'), $starttime);
// process the uri and setup the Reg variables
Config::processURI();
// wait till after all the config files are loaded before loading in the autoload files
Autoloader::loadFiles();
// build the controller class name
$load['name'] = Config::uriToClass(Reg::get("URI.working.controller"));
if (Reg::hasVal("Branch.name")) {
$load['branch'] = Config::uriToClass(Reg::get("Branch.name"));
}
$load['type'] = 'Controller';
$load = implode('_', $load);
// create an instance of the controller
$controller = new $load();
// run the _showView method in the loaded controller
$controller->_showView();
} catch (EvergreenException $e) {
// handler for the EvergreenException class
$e->processError();
} catch (Exception $e) {
// handler for general exceptions
if (Config::read("System.mode") != "development") {
echo Config::read("Error.generalErrorMessage");
exit;
} else {
echo $e;
}
}
}