Exemplo n.º 1
0
 public static function boot()
 {
     Config::init();
     require_once SYS . 'model/database/connector.php';
     require_once COMPONENTS . 'database/nitrogen/nitrogen.php';
     require_once COMPONENTS . 'database/nitrogen/builder.php';
     require_once SYS . 'model/model.php';
     Autoload::load();
     Request::init();
     Response::init();
     Url::init();
     Log::init();
     $boot = new Bootstrap(Config::$path);
     $boot->getPage();
     $boot->getContent();
     if (Config::$profiler === true) {
         echo Log::render();
     }
 }
Exemplo n.º 2
0
 private function ___query($type, $useBindings = false)
 {
     try {
         $stmt = $this->db->prepare($this->query_string);
         if ($useBindings) {
             $bindings = array_values($this->query_string->getBindings());
         }
         $start = microtime(true);
         $exec = $useBindings ? $stmt->execute($bindings) : $stmt->execute();
         $qString = $useBindings ? $this->query_string->replace_with_bingings($this->query_string) : $this->query_string;
         if (Log::$profiler && Log::$log_query) {
             Log::query($qString, $start);
         }
     } catch (PDOException $e) {
         die($e);
     }
     if ($type == 'read') {
         return $stmt;
     }
     return $exec;
 }