示例#1
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $app = $this->app;
     $app['config']->package('barryvdh/laravel-debugbar', $this->guessPackagePath() . '/config');
     if (!$this->shouldUseMiddleware()) {
         $app->after(function ($request, $response) use($app) {
             $debugbar = $app['debugbar'];
             $debugbar->modifyResponse($request, $response);
         });
     }
     $this->app['router']->get('_debugbar/open', array('as' => 'debugbar.openhandler', function () use($app) {
         $debugbar = $app['debugbar'];
         if (!$debugbar->isEnabled()) {
             $app->abort('500', 'Debugbar is not enabled');
         }
         $openHandler = new \DebugBar\OpenHandler($debugbar);
         $data = $openHandler->handle(null, false, false);
         return \Response::make($data, 200, array('Content-Type' => 'application/json'));
     }));
     if ($this->app['config']->get('laravel-debugbar::config.enabled')) {
         /** @var LaravelDebugbar $debugbar */
         $debugbar = $this->app['debugbar'];
         $debugbar->boot();
     }
 }
 public function index(SS_HTTPRequest $request)
 {
     if (!DebugBar::config()->enable_storage) {
         return $this->httpError(404, 'Storage not enabled');
     }
     $debugbar = DebugBar::getDebugBar();
     if (!$debugbar) {
         return $this->httpError(404, 'DebugBar not enabled');
     }
     $openHandler = new DebugBar\OpenHandler($debugbar);
     $openHandler->handle();
     exit;
     // Handle will echo and set headers
 }
示例#3
0
文件: open.php 项目: strikles/php
<?php

include __DIR__ . '/../../vendor/autoload.php';
global $debugbar;
$debugbar = new DebugBar\StandardDebugBar();
$debugbar->setStorage(new DebugBar\Storage\FileStorage(__DIR__ . '/../storage/logs'));
$openHandler = new DebugBar\OpenHandler($debugbar);
$openHandler->handle();