Rest is added in Service Provider
Inheritance: extends DebugBar\DebugBar
Example #1
0
 /**
  * Based on Twig_Extension_Debug / twig_var_dump
  * (c) 2011 Fabien Potencier
  *
  * @param Twig_Environment $env
  * @param $context
  */
 public function debug(Twig_Environment $env, $context)
 {
     if (!$env->isDebug() || !$this->debugbar) {
         return;
     }
     $count = func_num_args();
     if (2 === $count) {
         $data = [];
         foreach ($context as $key => $value) {
             if (is_object($value)) {
                 if (method_exists($value, 'toArray')) {
                     $data[$key] = $value->toArray();
                 } else {
                     $data[$key] = "Object (" . get_class($value) . ")";
                 }
             } else {
                 $data[$key] = $value;
             }
         }
         $this->debugbar->addMessage($data);
     } else {
         for ($i = 2; $i < $count; $i++) {
             $this->debugbar->addMessage(func_get_arg($i));
         }
     }
     return;
 }
 public function boot(LaravelDebugbar $debugBar, EventDispatcher $eventDispatcher, ViewComposerCollector $viewComposerCollector)
 {
     $eventDispatcher->listen("creating: *", function (View $view) use($viewComposerCollector, $eventDispatcher) {
         foreach ($this->findApplicableComposers($view, $eventDispatcher) as $composer) {
             $viewComposerCollector->addViewComposer($view, $composer);
         }
     });
     $debugBar->addCollector($viewComposerCollector);
 }
Example #3
0
 /**
  * @param EntityManagerInterface $em
  * @param Configuration          $configuration
  */
 public function register(EntityManagerInterface $em, Configuration $configuration)
 {
     if ($this->debugbar->hasCollector('doctrine')) {
         $debugStack = $this->debugbar->getCollector('doctrine')->getDebugStack();
     } else {
         $debugStack = new DebugStack();
         $this->debugbar->addCollector(new DoctrineCollector($debugStack));
     }
     $configuration->setSQLLogger($debugStack);
 }
Example #4
0
 /**
  * Handle an incoming request.
  *
  * @param  Request  $request
  * @param  Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     try {
         /** @var \Illuminate\Http\Response $response */
         $response = $next($request);
     } catch (Exception $e) {
         $response = $this->handleException($request, $e);
     }
     // Modify the response to add the Debugbar
     $this->debugbar->modifyResponse($request, $response);
     return $response;
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $configPath = __DIR__ . '/../config/debugbar.php';
     $this->mergeConfigFrom($configPath, 'debugbar');
     $this->app->alias('DebugBar\\DataFormatter\\DataFormatter', 'DebugBar\\DataFormatter\\DataFormatterInterface');
     $this->app->singleton('debugbar', function ($app) {
         $debugbar = new LaravelDebugbar($app);
         $sessionManager = $app['session'];
         $httpDriver = new SymfonyHttpDriver($sessionManager);
         $debugbar->setHttpDriver($httpDriver);
         return $debugbar;
     });
     $this->app->alias('debugbar', 'Barryvdh\\Debugbar\\LaravelDebugbar');
     $this->app['command.debugbar.clear'] = $this->app->share(function ($app) {
         return new Console\ClearCommand($app['debugbar']);
     });
     $this->commands(array('command.debugbar.clear'));
 }
 /**
  * 
  *
  * @static 
  */
 public static function offsetUnset($key)
 {
     //Method inherited from \DebugBar\DebugBar
     return \Barryvdh\Debugbar\LaravelDebugbar::offsetUnset($key);
 }
Example #7
0
 /**
  * @param string $name
  */
 protected function stopDebugMeasure($name)
 {
     if ($this->debugBar) {
         $this->debugBar->stopMeasure($name);
     }
 }