private function __construct() { $this->classloader = Classloader::getInstance(); $this->classloader->initLoadLib(); $this->dataConnector = DataConnector::getInstance(); $this->routingEngine = RoutingEngine::getInstance(); $this->templateEngine = TemplateEngine::getInstance(); }
private function logToDatabase($msg, $type) { DataConnector::getInstance()->query("INSERT INTO log (id,time,type,message,url) VALUES (NULL,NOW(),{$type},{$msg}," . $_SERVER['REQUEST_URI'] . ")"); }
/** * 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); }