public function getOpenHandler() { Debugbar::disable(); $debugbar = App::make('debugbar'); $openHandler = new OpenHandler($debugbar); $openHandler->handle(); }
public function handle() { $debugbar = $this->app['debugbar']; if (!$debugbar->isEnabled()) { $this->app->abort('500', 'Debugbar is not enabled'); } $openHandler = new OpenHandler($debugbar); $data = $openHandler->handle(null, false, false); return new Response($data, 200, array('Content-Type' => 'application/json')); }
public function handleAction() { $debugbar = $this->debugbar; $debugbar->enable(); $openHandler = new OpenHandler($debugbar); $data = $openHandler->handle(null, false, false); $response = new Response($data, 200); $response->setHeader('Content-Type', 'application/json'); return $response; }
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); }
/** * Return Clockwork output * * @param $id * @return mixed * @throws \DebugBar\DebugBarException */ public function clockwork($id) { $request = ['op' => 'get', 'id' => $id]; $debugbar = $this->debugbar; if (!$debugbar->isEnabled()) { $this->app->abort('500', 'Debugbar is not enabled'); } $openHandler = new OpenHandler($debugbar); $data = $openHandler->handle($request, false, false); // Convert to Clockwork $converter = new Converter(); $output = $converter->convert(json_decode($data, true)); return response()->json($output); }
protected function setAssetsRoute() { $renderer = $this->debugbar->getJavascriptRenderer(); $app = $this->app; $this->app->get('/_debugbar/fonts/:file', function ($file) use($renderer, $app) { // e.g. $file = fontawesome-webfont.woff?v=4.0.3 $files = explode('?', $file); $file = reset($files); $path = $renderer->getBasePath() . '/vendor/font-awesome/fonts/' . $file; if (file_exists($path)) { $T = new \finfo(FILEINFO_MIME); $app->response->header('Content-Type', $T->file($path)); echo file_get_contents($path); } else { // font-awesome.css referencing fontawesome-webfont.woff2 but not include in the php-debugbar. // It is not slim-debugbar bug. $app->notFound(); } })->name('debugbar.fonts'); $this->app->get('/_debugbar/resources/:file', function ($file) use($renderer, $app) { $files = explode('.', $file); $ext = end($files); if ($ext === 'css') { $app->response->header('Content-Type', 'text/css'); $renderer->dumpCssAssets(); } elseif ($ext === 'js') { $app->response->header('Content-Type', 'text/javascript'); $renderer->dumpJsAssets(); } })->name('debugbar.resources'); $this->app->get('/_debugbar/openhandler', function () { $openHandler = new OpenHandler($this->debugbar); $data = $openHandler->handle($request = null, $echo = false, $sendHeader = false); $this->app->response->header('Content-Type', 'application/json'); $this->app->response->setBody($data); })->name('debugbar.openhandler'); }
/** * Retrieve the persistent data of a certain request. * * @return void */ public static function getPersisted() { $openHandler = new OpenHandler(self::createDebuggerInstance()); $openHandler->handle(); }