Ejemplo n.º 1
0
 public function __construct()
 {
     $config = Config::get('application');
     Session::start();
     if (get_magic_quotes_gpc()) {
         function stripslashes_deep($value)
         {
             $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
             return $value;
         }
         $_POST = stripslashes_deep($_POST);
         $_GET = stripslashes_deep($_GET);
         $_COOKIE = stripslashes_deep($_COOKIE);
         $_REQUEST = stripslashes_deep($_REQUEST);
     }
     if (isset($config['response']['defaultHeaders'])) {
         foreach ($config['response']['defaultHeaders'] as $header) {
             header($header);
         }
     }
     AbstractDb::$useMemcacheForMetadata = $config['useCache'];
     Object::$debug = MySQL::$monitorQueries = $config['debug'];
     Db::setConfig(Config::get('database'));
     $this->initialize();
 }
Ejemplo n.º 2
0
 /**
  * @return IDb
  */
 public static final function db()
 {
     return Db::connection(static::$connectionName);
 }