예제 #1
0
 public function testVariableIsSet()
 {
     $this->assertTrue(EE::is_set('foo'));
     $this->assertFalse(EE::is_set('cat'));
     $this->assertTrue(EE::is_set('x', 'y'));
     $this->assertFalse(EE::is_set('x', 'y', 'dog'));
 }
예제 #2
0
 public function __call($method, $args)
 {
     if (!EE::is_set('pdo_query_logger')) {
         EE::set('pdo_query_logger', array());
     }
     if ($method == 'execute') {
         EE::set('pdo_query_logger', md5($this->statement), array('statement' => $this->statement, 'args' => isset($args[0]) ? $args[0] : array(), 'sql' => self::params($this->statement, $args[0])));
     }
     return call_user_func_array(array($this->res, $method), $args);
 }
예제 #3
0
 public static function start()
 {
     if (!self::$started) {
         $session_config = EE::is_set('_config', 'session') ? EE::get('_config', 'session') : array();
         if (sizeof($session_config)) {
             foreach ($session_config as $key => $value) {
                 ini_set('session.' . $key, $value);
             }
         }
         session_start();
         self::$started = true;
     }
 }
예제 #4
0
 public static function load($locale = null)
 {
     self::$translations = array();
     if (!$locale && EE::is_set('_config', 'locale')) {
         $locale = EE::get('_config', 'locale');
     }
     if ($locale) {
         $file = EE::get('_dir') . '/' . EE::APP_TRANSLATIONS_DIR . '/' . $locale . '.php';
         if (file_exists($file)) {
             self::$translations = (require $file);
             return true;
         }
     }
     return false;
 }