/** * Prepares the loader to do whatever necessary. */ function __construct() { // Load database self::$database = Database::getInstance(); // Link an instance of the loader to itself self::$instance =& $this; //Load all mods ModLoader::getInstance(); }
/** * database 加载数据库 * @return null */ private function database() { $db = Loader::database(); if (!$db) { exit('<h1>Database Config Error!!!</h1>'); } $num = strpos(get_class($this), 'Model'); if ($num != 0) { $db->table = Config::database('table_pre') . substr(get_class($this), 0, $num); } else { $db->table = Config::database('table_pre') . substr($this->model, 0, strpos($this->model, 'Model')); } $db->_reset(); $this->db = $db; }
// E_DEPRECATED required for php 5.3.0 because of depreciated function calls in 3rd party libs (adodb). } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); } ## Startup check ## require dirname(__FILE__) . '/config/base_pre.php'; ## Startup check ## require dirname(__FILE__) . '/startup/config_check.php'; ## Check to see if, based on a config variable, we need to point to an alternate core ## require dirname(__FILE__) . '/startup/updated_core_check.php'; ## Load the base config file ## require dirname(__FILE__) . '/config/base.php'; ## First we ensure that dispatcher is not being called directly require dirname(__FILE__) . '/startup/file_access_check.php'; ## Load the database ## Loader::database(); ## Startup cache ## Loader::library('cache'); Cache::startup(); ## Load required libraries ## Loader::library('object'); Loader::library('log'); Loader::library('localization'); Loader::library('request'); Loader::library('events'); Loader::library('model'); Loader::library('item_list'); Loader::library('view'); Loader::library('controller'); Loader::library('file/types'); Loader::library('block_view');