/** * Set storage for debugbar * * @return boolean */ protected function setStorage() { if (!isset($this->config['open_handler_url'])) { return false; } $path = $this->config['cache_path']; $cache_path = $path === '' ? APPPATH . 'cache/debugbar/' : $path; file_exists($cache_path) or mkdir($cache_path, DIR_WRITE_MODE, true); $this->debugbar->setStorage(new FileStorage($cache_path)); return true; }
public function open_handler() { $this->config->load('profiler', true); $path = $this->config->item('cache_path', 'profiler'); $debugbar = new DebugBar(); $debugbar->setStorage(new FileStorage($path)); $openHandler = new OpenHandler($debugbar); $data = $openHandler->handle(NULL, FALSE, FALSE); $this->output->enable_profiler(FALSE); $this->output->set_content_type('json'); $this->output->set_output($data); }
/** * @param DebugBar $debugbar */ protected function selectStorage(DebugBar $debugbar) { $config = $this->app['config']; if ($config->get('debugbar.storage.enabled')) { $driver = $config->get('debugbar.storage.driver', 'file'); switch ($driver) { case 'pdo': $connection = $config->get('debugbar.storage.connection'); $table = $this->app['db']->getTablePrefix() . 'phpdebugbar'; $pdo = $this->app['db']->connection($connection)->getPdo(); $storage = new PdoStorage($pdo, $table); break; case 'redis': $connection = $config->get('debugbar.storage.connection'); $storage = new RedisStorage($this->app['redis']->connection($connection)); break; case 'file': default: $path = $config->get('debugbar.storage.path'); $storage = new FilesystemStorage($this->app['files'], $path); break; } $debugbar->setStorage($storage); } }
/** * @param DebugBar $debugbar */ protected function selectStorage(DebugBar $debugbar) { $config = $this->config; if ($config->storage->enabled) { $driver = $config->storage->get('driver', 'file'); switch ($driver) { case 'mongodb': $connection = $config->storage->mongodb->connection; $db = $config->storage->mongodb->db; $options = $config->storage->mongodb->options; $collection = $config->storage->mongodb->collection; $storage = new MongoDB($connection, $db, $collection, $options); break; default: $path = $config->storage->path; $storage = new Filesystem($path); break; } $debugbar->setStorage($storage); } }
/** * @param DebugBar $debugbar */ protected function selectStorage(DebugBar $debugbar) { $config = $this->config; if ($config->storage->enabled) { $driver = $config->storage->get('driver', 'file'); switch ($driver) { //TODO:: other driver default: $path = $config->storage->path; $storage = new FilesystemStorage($path); break; } $debugbar->setStorage($storage); } }