Exemplo n.º 1
0
 private function __construct()
 {
     $this->classloader = Classloader::getInstance();
     $this->classloader->initLoadLib();
     $this->dataConnector = DataConnector::getInstance();
     $this->routingEngine = RoutingEngine::getInstance();
     $this->templateEngine = TemplateEngine::getInstance();
 }
Exemplo n.º 2
0
 private function logToDatabase($msg, $type)
 {
     DataConnector::getInstance()->query("INSERT INTO log (id,time,type,message,url) VALUES  (NULL,NOW(),{$type},{$msg}," . $_SERVER['REQUEST_URI'] . ")");
 }
Exemplo n.º 3
0
 /**
  * Creats table of the model like it is defined.
  * This is very usefull for the install process in your webapp.
  */
 public function createDatabaseTable()
 {
     $notFirst = false;
     $query = 'CREATE TABLE ' . $this->table . ' (';
     foreach ($this->attributes as $attribute) {
         if ($notFirst) {
             $query .= ',';
         } else {
             $notFirst = true;
         }
         $query .= $attribute[0] . ' ' . $attribute[1];
     }
     $query .= ');';
     DataConnector::getInstance()->query($query);
 }