GithubHelp home page GithubHelp logo

barryvdh / laravel-debugbar Goto Github PK

View Code? Open in Web Editor NEW
16.6K 16.6K 1.5K 2.72 MB

Debugbar for Laravel (Integrates PHP Debug Bar)

License: MIT License

PHP 81.16% CSS 18.74% Blade 0.11%
debugbar hacktoberfest laravel

laravel-debugbar's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-debugbar's Issues

Exception when uploading binary files

When using HTML form to upload binary file an exception is thrown in debugbar:

json_encode() [function.json-encode]: Invalid UTF-8 sequence in argument

In \vendor\maximebf\debugbar\src\DebugBar\JavascriptRenderer.php

protected function getAddDatasetCode($requestId, $data, $suffix = null)
{
    $js = sprintf("%s.addDataSet(%s, \"%s\"%s);\n",
        $this->variableName,
        json_encode($data), //-------------> row 790

I assume this is used to display the POST data but it can't chew up the binary.

Exception Class 'session.store' does not exist when publishing assets under Laravel 4.0.7

The following exception is thrown when publishing assets under Laravel 4.0.7 with the 'debug' => true in app configuration:

$ php artisan debugbar:publish
public path: /app/public
{"error":{"type":"ReflectionException","message":"Class session.store does not exist","file":"\/app\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php","line":296}}

The same exception is thrown when making requests via the web.

I have a patch that can fix this particular issue but I don't know if it is the best way to handle it or whether Laravel 4.0 is even on the support list for the debugbar. Will submit a pull request and you can decide if you want to keep it.

Debugbar and Bootstrap3 close button

I think there is an issue with the debugbar and twitter bootstrap3. As can be seen in the image, the FontAwsome close button is not displayed correctly. It does not matter if the scroll bar is present.

I tried it with the css and js vendor files set to true and false, both did not work. On a pc or laptop it is not such a problem, you still can manage to click the x, but on a tablet or phone it is more of a challenge.

capture_

query durations

Thanks for great package.
Please add some more digits to database query results like 0.00256 ms.

also

Debugbar::measure('Two sql Queries', function() {
    $designs = Design::orderBy('id', 'DESC')->take(5)->get();
    $notices = Notice::orderBy('id', 'DESC')->take(5)->get();
});

"Two sql Queries (4ms)"

has to be more digits.

4.1.9 - doesnt seem to be loading the middleware.

I am using the Cartalyst Platform dev branch, which uses the latest laravel framework... so after looking at the service provider, altering this one bit did the trick...

    if(!defined('PLATFORM_VERSION') and version_compare($app::VERSION, '4.1', '>=')){
        $app->middleware('Barryvdh\Debugbar\Middleware', array($app));
    }else{
        $app->after(function ($request, $response) use($app)
        {
            $debugbar = $app['debugbar'];
            $debugbar->modifyResponse($request, $response);
        });
    }

Readme issue

Hi just wondering if this is an issue or not

"post-update-cmd": [
    "php artisan ide-helper:generate",
    "php artisan debugbar:publish"
],

should the artisan command for the ide-helper be in there ive just helped a college out whos using your package and this seemed to be the issue.

[RuntimeException]
Error Output:
[InvalidArgumentException]
There are no commands defined in the "ide-helper" namespace.

When i removed that line it worked fine. I dont have your ide-helper package installed as I dont need it and looking at the debugbar package I cant see that it includes it in the install.

I hope ive got that right,

thanks

Problem with ajax requests

Hi,

When using the debugbar with ajax requests I always get an error where the browser returns a 'Request Failed' error. I found that if I comment out the following line in ServiceProvider.php it works again.

...
}elseif( $request->isXmlHttpRequest() ){
    $debugbar->sendDataInHeaders();
}elseif(
...

Would it be possible to make it optional whether or not to apply the debug data in the http headers for ajax requests?

Thanks

[enhancement] Ability to disable the debugbar per controller

Hi

Nice package for Laravel!

I have a controller where i don't want to show the debugbar at all, even not on the dev env.

I've tried to set Config::set('laravel-debugbar::config.enabled', false); in a controllers constructor. But the check happens in the boot() function which is called before a controller constructor.

So I've made a change on line 196 in the ServiceProvider.php file, from:

if( $app->runningInConsole()){
    return;
}

to this:

if( $app->runningInConsole() || !$app['config']->get('laravel-debugbar::config.enabled')){
    return;
}

Is this the easiest way to disable the debugbar per controller?

Using DebugBar only in local environment

I've a question and I can't figured it out.

I'm using, locally, your awesome debugbar and it works like a charm. But the problem comes when I publish, remotely, my project and the debugbar is still there.

Inside /boostrap/start.php I've

$env = $app->detectEnvironment(array(
    'local' => array('ludo.*','Ludo-MBPro.*'),
));

That allow me to use a /app/local/ folder for local configuration and it works fine for everythings. How can I enable debugbar to works only in local Env? Is there any kind of setup ? I can't spot it.

Edit: At the moment I've setup the ServiceProvider and the Alias inside the /app/local/app.php file. Is this the best way to handle it?

Can't see BeforeFilter() when using Route::resource with filters in __construct

Thanks, barryvdh.

I'm using your debugbar when developing my site. It's a nice piece of code and very handy.

But enough chitchat, here's the issue. I'm using a Controller and added it to my Routes.php like so:

Route::resource('dashboard/gebruikers', 'GebruikersController');

In the controller i have a __construct function like so:

public function __construct()
{
    $this->beforeFilter('dashboard');
    $this->beforeFilter('csrf', array('on' => array('put','post')));
}    

But now i don't see the BeforeFilter() in tab Route from the Debugbar. Please be aware that i refer to the first 'run' (if you could call it like that), the 'put' method, because it has to check the csrf-token.

I hope this helps making Debugbar an even better tool.

Route collector error when changing locale

I have a fairly simple way of switching locales by adding the language code to the beginning of the route. Then in my global before filter, I just grab segment(1) and deal with locale switching as applicable. I am using Laravel 4 (laravel/framework (4.0.x-dev b78c92d)).

Unfortunately, when the route collector is set to true, I receive the following error:

ErrorException

Argument 2 passed to Barryvdh\Debugbar\DataCollector\SymfonyRouteCollector::getRouteInformation() must be an instance of Symfony\Component\Routing\Route, null given, called in C:\xampp\htdocs\myproject\vendor\barryvdh\laravel-debugbar\src\Barryvdh\Debugbar\DataCollector\SymfonyRouteCollector.php on line 24 and defined

My global before filter:

App::before(function($request)
{
    if ( in_array(Request::segment(1), Config::get('app.languages')) ) {
        Session::put('locale', Request::segment(1));
        return Redirect::to(substr(Request::path(), 3));
    }
    if ( Session::has('locale') ) {
        App::setLocale(Session::get('locale'));
    }
});

I have the latest update as per composer and the package is installed using dev-master.

This is how I'm setting up Debugbar in my project:

use DebugBar\StandardDebugBar;

$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();
$pdo = new DebugBar\DataCollector\PDO\TraceablePDO(new PDO('mysql:host=localhost;dbname=db','user',''));
$debugbar->addCollector(new DebugBar\DataCollector\PDO\PDOCollector($pdo));

and in the html:

{{ $debugbarRenderer->renderHead() }}
{{ $debugbarRenderer->render() }}

Please let me know if you require any additional information.

Show Laravel's Session

Hi,

It would be great if debugbar would have a section which shows information and the content of the Laravel's Session.

jQuery.noConflict

Please, remove this line from your generated (directly written in html) javascript code.
I causes very stupid errors and it took me over an hour to figure out whats the problem!
Because of this line, any other code can use $ as jQuery's accessor.

XHR requests and view collectors

We've just come up against a bug that has caused us a few hours of head scratching.

We're using PJAX (https://github.com/defunkt/jquery-pjax), which basically forces all requests to use ajax. In some cases, however, we found that the ajax response would fail, and the view would be rendered normally instead of via ajax.

We finally managed to track this down to using Chrome browser (FF works fine), and when the response has a large number of views, or those views have a large amount of data. We suspected that Chrome javascript engine has some kind of limit that is being exceeded.... and then we found http://stackoverflow.com/a/3436155 which confirmed this.

In production it is no problem at all, since debugbar is disabled, but it would be nice if we could get this working in dev. There are a few ways around this - maybe one option is to not collect view data if its an ajax request?

Allow Debugbar to be enabled during runtime

I need to enable debugbar based on a cookie, but it seems that only the disabling functionality is implemented.

App::before(function($request)
{
    /*
     * check debugbar cookie
     */
    if (Cookie::has('debugbar'))
    {
        Config::set('app.debug', true);

        Config::set('laravel-debugbar::config.enabled', true);
    }
});

the above code does not work.

Error publishing assets

I'm having trouble publishing the assets as described in the readme. I added debugbar to composer.json, updated it, and added it to the providers in app.php.

Running php artisan debugbar:publish gives me the following error:

[InvalidArgumentException]                                  
There are no commands defined in the "debugbar" namespace.

Error With setRenderSqlWithParams

Call to undefined method DebugBar\DataCollector\PDO\PDOCollector::setRenderSqlWithParams()

Occurs in line 183 of src\Barryvdh\Debugbar\LaravelDebugBar.php.

Tooltip typo

There is a little typo in the tooltip for Version.
Vresion instead of Version.

HTML escape database query parameter

Hey,

having trouble through some sql inserts of html content (html emails). The values of the parameter for database queries doesn't seem to be escaped and are breaking my and the laravels-debugbar layout. Not sure if this belongs to this package or the debugbar itself.

Profiler Breaks on Laravel 4.1 upgrade

Running composer to update to the 4.1 branch of Laravel returns an error on the profiler:

{"error":{"type":"ErrorException","message":"Argument 1 passed to Barryvdh\\Debugbar\\SymfonyHttpDriver::__construct() must be an instance of Symfony\\Component\\HttpFoundation\\Session\\Session, instance of Illuminate\\Session\\Store given, called in C:\\root\\laravel4\\vendor\\barryvdh\\laravel-debugbar\\src\\Barryvdh\\Debugbar\\ServiceProvider.php on line 193 and defined","file":"C:\\root\\laravel4\\vendor\\barryvdh\\laravel-debugbar\\src\\Barryvdh\\Debugbar\\SymfonyHttpDriver.php","line":17}} Script php artisan optimize handling the post-update-cmd event returned with an error

Couldn't close Debugbar when dragged all the way up

I dragged the Debugbar all the way up, so it filled up Firefox totally. I couldn't get it down again, though. I fixed it with the help of the Firefox developers tool by setting the height of the main DIV of the Debugbar to 80%, and dragged it down again myself.

Call to undefined method Illuminate\Session\Store::getFlashBag()

I just updated to the latest and straight away got this error.

Call to undefined method Illuminate\Session\Store::getFlashBag()
in
symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php:82

When i disable debugbar it all works fine!

running Laravel 4.1-dev

FatalErrorException: Call to undefined method Barryvdh\Debugbar\Facade::warning()

Hi

After adding 'Debugbar' => 'Barryvdh\Debugbar\Facade' to the aliases array in app.php

I then try to execute one of my controller actions containing the following:

public function getIndex(){
Debugbar::warning('Watch out..');
}

But I receive the following error:

 Symfony \ Component \ Debug \ Exception \ FatalErrorException
Call to undefined method Barryvdh\Debugbar\Facade::warning()

Have I included the facade incorrectly?

Thanks a lot for you help.

Routes collector throwing an error

I get this exception with the routes collector enabled:

Argument 1 passed to Illuminate\Routing\Router::findPatternFilters() must be an instance of Symfony\Component\HttpFoundation\Request, string given, called in /var/www/scubaclick.com/vendor/barryvdh/laravel-debugbar/src/Barryvdh/Debugbar/DataCollector/SymfonyRouteCollector.php on line 88

Also, on the views collector, my view names overlap the dumped variables quite a bit on the first line (large app with some view files being 4 folders deep), making things basically unreadable. It'd be better if the dump would only start on the next line.

Debugbar and multitenancy: set DB::connection

I'm working on a multitenant website using the same approach as described here: http://forums.laravel.io/viewtopic.php?id=9315

Basically there's a tenant database that is queried first to get the tenant that is requested. Next the DB::connection is set to the correct tenant. The debugbur only picks up data from the the global tenants DB::connection, not from the tenant DB itself.

Is there a way to tell debugbar which connection to use?

@barryvdh: Sorry, posted this question first on the Laravel forums (http://forums.laravel.io/viewtopic.php?id=15381) before realizing it might be better to post here, so excuse me for the double post.

[Bug] HTML not escaped with view data

This may be an upstream issue but it looks like the view data needs htmlentities before displaying the output. I am hoping to see the view data html but instead see this:

screen shot 2013-10-26 at 11 01 15 am

Viewing source outputs to:

screen shot 2013-10-26 at 11 01 41 am

Error upon install re: reflection

I feel like a big idiot, but for the life of me I can't seem to get the debug-bar to work.

After I've installed it using composer, and immediately upon adding the serviceprovider to app.php, I get the following error both from the browser and artisan:

ReflectionException
Class files does not exist
open: /Users/jake/documents/workspace/evals/vendor/laravel/framework/src/Illuminate/Container/Container.php
    // hand back the results of the functions, which allows functions to be
    // used as resolvers for more fine-tuned resolution of these objects.
    if ($concrete instanceof Closure)
    {
        return $concrete($this, $parameters);
    }

    $reflector = new ReflectionClass($concrete);

    // If the type is not instantiable, the developer is attempting to resolve
{"error":{"type":"ReflectionException","message":"Class files does not exist","file":"\/Users\/jake\/documents\/workspace\/evals\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php","line":308}}

Here are my composer require:

"require": {
        "laravel/framework": "4.0.10",
        "cartalyst/sentry": "2.0.*@dev",
        "barryvdh/laravel-ide-helper": "dev-master",
        "friendsofsymfony/oauth2-php": "1.0.*@dev",
        "guhelski/forecast-php": "dev-master",
        "maximebf/debugbar": ">=1.0.0",
        "barryvdh/laravel-debugbar": "dev-master",
        "rtablada/package-installer": "dev-master"
    },

Any suggestions?

I've completed removed my vendor folder, composer.lock files, ran composer dump-autoload, everything!

Decoupling Jquery dependancy

Hi

first of id like to say im a huge fan of the package its really helped me with developing in laravel, I know this isnt really a issue but more of a feature request but I was wondering if you had perhaps thought about using vanilla javascript instead of having to rely on jquery?

The reason for suggesting this is that im currently working on a project thats using require.js and when i use this package im having a lot of issues on the javascript side of things due to the require.js handling all the loading.

removing the dependancy from jquery would in my mind be a great feature I know it would mean re-coding the whole js side.

Sorry if ive offended suggesting this.

thanks again for all the good work

Dan

Generic css-class names causes problems

There are to many generic css class-names that makes that i cant use it and i bet more people will have the same issues. All class-classes needs to be prefixed.

Examples for none-prefixed classes:
active
list-item
key
value
toolbar
icon-search
status
sql
....

all these classes needs to be prefixed to avoid conflicts.

urlencode() expects parameter 1 to be string, array given

When using this package with my laravel 4.1-dev version and sentry 2 i get the following error.
urlencode() expects parameter 1 to be string, array given

It only happens when i try to log in with the remember me to true.

The backtrace on the error shows its trigger from

/vendor/barryvdh/laravel-debugbar/src/Barryvdh/Debugbar/ServiceProvider.php
Line 242: $debugbar->stackData();

I don't know if this is directly related to the debugbar but when i turn debugbar off it works fine.

EDIT

For the time being that laravel 4.1 is not released and/or sentry is not compatible i found a quick fix for my problem

Just before the redirect i do the following
\Config::set('laravel-debugbar::config.collectors.symfony_request',false);
And then do my redirect. This is only when a cookie has been set in app->after()

Composer Issue

Why do I get this error with laravel-debugbar's version and all minimum stability config

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for barryvdh/laravel-debugbar dev-master -> satisfiable by barryvdh/laravel-debugbar[dev-master].
    - barryvdh/laravel-debugbar dev-master requires maximebf/debugbar dev-master -> no matching package found.

boot() function failure since upgrade to laravel 4.1 (blank screen, no errors)

Since I've upgraded to Laravel 4.1 I am getting a blank screen and no errors at all. Finally I went through every line of code and came to this package as point of failure.

Something seems to be wrong during the boot process at the moment of calling the boot() function of the service provider again on my server.

https://github.com/barryvdh/laravel-debugbar/blob/master/src/Barryvdh/Debugbar/ServiceProvider.php#L24

My Apache log also only says
[Thu Dec 26 13:40:36 2013] [notice] child pid 2909 exit signal Segmentation fault (11)

If you need any more information let me know. I have no more idea what I could do.

Query params substitution

It would be great if this could automatically substitute the params for each query into the query string

Allowed memory size exhausted after installation

Hi

At installation, after having published the assets successfully with php artisan debugbar:publish

I then try to refresh any page on my site and get

exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Allowed memory size of 679477248 bytes exhausted (tried to allocate 669253632 bytes)' 

I had increased my memory limit in php.ini from 512M to 648M to no avail.

Thanks.

Jon.

Database queries aren't showing if using different database connection than default

As the title says. If my Eloquent models specify a different database connection than the one specified in the default database parameter in /app/config/database.php the debugbar shows "Database 0" in the bar. If I change the default database connection to the one my Eloquent models are using then the debugbar will show the correct queries. Is there a way to get this to work with multiple databases as this is a very useful tool?

How to user Debugbar with API development?

Hi,

We are developing an API on Laravel. Thus we have different public folder than Laravel's public, and there we have built the front-end with AngularJS. Is it possible we could install assets to our Angular web application, and transmit Debugbar's data via API requests?

Collecting events does not work with Laravel 4.1.x-dev

I added laravel-debugbar to an empty 4.1.x-dev laravel installation and tried to activate collecting events (publishing config, setting 'events' => true).

Problem: In 4.1.x-dev the event name isn't added to $payload variable in Illuminate\Events\Dispatcher::fire() method anymore. So your code to collect event names in Barryvdh\Debugbar\LaravelDebugbar::boot() doesn't work.

Call to undefined method Illuminate\Session\Store::driver() under Laravel Framework version 4.0.7

Here is what's in the error log:

log.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Illuminate\Session\Store::driver()' in .../vendor/barryvdh/laravel-debugbar/src/Barryvdh/Debugbar/LaravelDebugBar.php:253
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []

This is using Laravel Framework version 4.0.7 with cartalyst/sentry@39d0fdb (2013-09-24 10:01:22)

cartalyst/sentry:dev-master@57e8bac

Updating to laravel framework 4.0.9 and cartalyst/sentry@57e8bac (latest) gets rid of the error. However, updating either of them individually replaces this error with two different errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.