Beispiel #1
0
 /**
  * 获取Autoloader 实例
  * @return XF_Loader_Autoloader
  */
 public static function getInstance()
 {
     if (self::$_instance == NULL) {
         self::$_instance = new self();
         //注册自动加载
         spl_autoload_register(array(self::$_instance, 'autoload'));
     }
     return self::$_instance;
 }
Beispiel #2
0
 /**
  * 初始化
  * @access private
  * @return void
  */
 private function _init($isCommandLine, $is_compile_model)
 {
     $this->_is_command_line = $isCommandLine;
     if ($isCommandLine === FALSE) {
         $this->_runTime($is_compile_model);
         //设定错误和异常处理
         register_shutdown_function(array('XF_Application', 'fatalError'));
         set_error_handler(array('XF_Application', 'appError'));
         set_exception_handler(array('XF_Application', 'appException'));
         XF_Loader_Autoloader::getInstance();
         $this->_setPHPSettings(XF_Config::getInstance()->getPHPSettings());
     } else {
         $this->_runCommandLineTime($is_compile_model);
         XF_Loader_Autoloader::getInstance();
     }
 }