Ejemplo n.º 1
0
Archivo: Hmvc.php Proyecto: Rgss/imp
 /**
  * 创建实例
  * 
  * @return \Imp\Mvc\unknown
  */
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new Hmvc();
     }
     self::$hmvcPath = Config\Config::get('hmvc_dir');
     return self::$instance;
 }
Ejemplo n.º 2
0
 public static function init()
 {
     error_reporting(E_ALL);
     if (Config\Config::get('WHOOPS_ERROR', FALSE) || Config\Config::get('DEBUG', FALSE)) {
         $whoops = new \Whoops\Run();
         $request = \Biome\Biome::getService('request');
         if ($request->acceptHtml()) {
             $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
         } else {
             if (\Whoops\Util\Misc::isCommandLine()) {
                 $whoops->pushHandler(new \Whoops\Handler\PlainTextHandler());
             } else {
                 $whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler());
             }
         }
         $whoops->register();
     }
 }