Example #1
0
 /**
  * Construct
  */
 public function __construct()
 {
     $this->config = new Config();
     $this->router = new Router($this->config);
     $this->view = new View($this->config);
     //we need database config
     DB::$host = $this->config->get('dbServer');
     DB::$user = $this->config->get('dbUser');
     DB::$password = $this->config->get('dbPass');
     DB::$dbName = $this->config->get('dbDatabase');
     //on production custom database error handler
     if (!IS_WORKSPACE) {
         $this->setDatabaseErrorHandlers();
     } else {
         DB::$success_handler = array("core\\Debug", 'query');
     }
     self::$host = $this->config->get('project_host');
 }
Example #2
0
 public static function debugMode($handler = true)
 {
     DB::$success_handler = $handler;
 }