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')); }
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); }
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; } }
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; }