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 init($config = null, $routes = null) { // Set current directory for correct app includes self::$dir = dirname(__FILE__); EE::set('_dir', self::$dir); // Use provided or load config from file if (!is_null($config)) { self::$config = $config; } else { self::$config = (require self::$dir . '/' . self::APP_CONFIG); } EE::set('_config', self::$config); // Define error level if (isset(self::$config['error_level'])) { error_reporting(self::$config['error_level']); } // Define whenever to log errors if (isset(self::$config['log_errors'])) { ini_set('log_errors', self::$config['log_errors']); } // Define timezone if (isset(self::$config['timezone'])) { date_default_timezone_set(self::$config['timezone']); } // Use provided or load routes file if (!is_null($routes)) { self::$routes = $routes; } else { self::$routes = (require self::$dir . '/' . self::APP_ROUTES); } EE::set('_routes', self::$routes); // Everything went fine return true; }
public function testVariableSet() { $this->assertTrue(EE::set('foo', 'bar')); $this->assertTrue(EE::set('x', array())); $this->assertTrue(EE::set('x', 'y', 'z')); }
public function custom_bar_action($path) { $id = isset($path[0]) ? $path[0] : null; EE::set('id', $id); $this->load_view('bar'); }