Пример #1
0
 public static function init($sServer = '')
 {
     self::$SHORT_PATH = substr(self::PATH, 1);
     require_once self::$sExceptionFile;
     //xdebug_disable();
     set_error_handler(self::$sExceptionClass . "::loadError");
     $autoload = self::getManager('autoload');
     $autoload->register('sylma', self::$SHORT_PATH . '/');
     ini_set("default_charset", 'utf-8');
     mb_internal_encoding('utf-8');
     require_once self::$sInitializerFile;
     //xdebug_start_code_coverage();
     $init = self::$aControlers['init'] = new self::$sInitializerClass();
     self::setManager('init', $init);
     try {
         self::$settings = $init->loadSettings($sServer, self::ROOT . self::PATH . self::PATH_OPTIONS);
         self::$result = $init->run(self::get('initializer'));
     } catch (core\exception $e) {
         $e->save();
         self::get('render')->set('gzip', false);
         self::$result = 'An error occured<br/><a href="/">Click here to go to homepage</a>';
         header('HTTP/1.0 404 Not Found');
         if (!self::isAdmin()) {
             //self::$result = $init->getError();
         } else {
         }
     }
     //var_dump(xdebug_get_code_coverage());
     //session_write_close();
 }