Code Monkey home page Code Monkey logo

silverstripe-debugbar's Introduction

SilverStripe DebugBar module

Build Status scrutinizer Code coverage

Installation

You can install the debug bar with Composer:

composer require --dev lekoala/silverstripe-debugbar

Documentation

Introduction

SilverStripe Debug Bar is a wrapper for PHP DebugBar which integrates with SilverStripe to provide more useful information about your projects. The Debug Bar can help you to easily identify performance issues, analyse environment settings and discover which parts of your code are being used.

For example, if your application is running the same database query multiple times in a loop, or a certain controller action is taking a long time to run, Debug Bar will highlight these bottlenecks so you can take steps to improve your overall site performance.

This module will:

  • Log framework execution based on available hooks
  • Log and profile database calls
  • Show all SilverStripe log entries
  • Show all session, cookie, requirements, SiteConfig and request data
  • Show current locale, framework/CMS version, current member
  • Show request timing/profiling and memory consumption

The DebugBar is automatically injected into any HTML response through the DebugBarMiddleware, and will only run in "dev" mode.

Screenshot

Execution timeline

The execution timeline ("Timeline" tab) provides you with a graphical overview of each controller and action, listing how long it takes for each to complete.

Execution timeline

The example above is from loading a page in the CMS.

You can also use our helper DebugBar::trackTime in order to start/stop a given measure. This will also work even before DebugBar is initialized allowing you, for example, to measure boot up time like this:

DebugBar::trackTime('create_request');
$request = HTTPRequestBuilder::createFromEnvironment();
// This line is optional : you can close it or it will be closed automatically before pre_request
DebugBar::trackTime('create_request');

Speaking of boot time, you can get a more accurate measure than the one provided by $_SERVER['REQUEST_TIME_FLOAT'] by defining the following constant in your index.php file.

require dirname(__DIR__) . '/vendor/autoload.php';
define('FRAMEWORK_BOOT_TIME', microtime(true));

This will give you a distinct php and framework boot time. This way, you can measure, for instance, the effects of doing a composer dumpautoload -o on your project.

Note : any pending measure will be closed automatically before the pre_request measure.

Database profiling

The "Database" tab allows you to view a list of all the database operations that a page request has made, and will group duplicated queries together. This can be useful to identify areas where performance can be improved, such as using DataObject::get_by_id() (which caches the result) instead of DataObject::get()->byID().

Database profiling

By clicking on one of the duplicate group badges in the bottom right corner, you can see groups of duplicated queries:

Duplicate grouping

To help you in debugging and optimising your application, it is recommended to leave the find_source option on. This will help you to identify what triggers the query and where to implement caching appropriately.

If you are using ?showqueries=1, you will also see that the usage has been optimised to display all queries nicely and their result on the page.

Also remember that if you use the d() helper, any string variable with "sql" in the name will be formatted as a SQL string.

Long running queries

When some queries take a long time to run they will be highlighted in red, with the request time (right hand side per item) highlighted in bold red text. The threshold for this time can be adjusted by modifying the DebugBar.warn_dbqueries_threshold_seconds configuration setting.

Long running queries

Note: The above example has been adjusted to be deliberately short. The default threshold value is one second for a long running query.

Large numbers of queries

If a page request performance is more than a certain number of queries, a warning message will be sent to the "Messages" tab. You can adjust the threshold for this with the DebugBar.warn_query_limit configuration setting.

Query threshold warning

System logs and messages

The "Messages" tab will show you a list of anything that has been processed by a SilverStripe logger during a page execution:

System logs and messages

You can filter the list by type by clicking on one of the log level buttons in the bottom right corner.

Note: At times, other DebugBar components may also send messages to this tab.

Template use

The "Templates" tab will show you how many template calls were made, and the file path relative to the project root directory for each.

This will only be populated when you are flushing your cache (?flush=1). When templates are cached, a notice will be displayed letting you know to flush to see the full list.

Templates

Partial caching hits and misses

The "TemplateCache" tab shows how effective your chosen partial cache key is (e.g. <% cached 'navigation', $LastEdited %>...<% end_cached %>). It does this by indicating whether a key has hit a cache or not.

Partial caching

Environment and other information

There is a variety of other useful information available via various tabs and indicators on the debug bar. See the screenshot below, and the arrows explained in order from left to right:

Other indicators

Tabs

  • Session: Displays a list of everything in your current SilverStripe session
  • Cookies: Displays a list of all cookies available in a request
  • Parameters: Displays all GET, POST and ROUTE parameters from the current request
  • Config: Displays a list of the current SiteConfig settings from the CMS
  • Requirements: Shows a list of all Requirements calls made during a page's execution
  • Middlewares: Shows a list of all Middlewares used for this request
  • Mails: Shows a list of all emails sent
  • Headers: Shows a list of all headers

Indicators

Hover over indicators to see:

  • Locale: The locale currently being used in the site
  • Version: The current SilverStripe software version being used
  • User: The name of the user currently logged in
  • Memory usage: The amount of memory used to generate a page
  • Request time: The total time to generate a page (see below)
Request time

The request time indicator shows you how long it took for the server to render a page, it doesn't include the time your browser takes to render it. You can use browser consoles to profile this aspect.

  • For a regular page load, the request time will have a green underline to indicate a healthy speed
  • For a slower page load, the request time will have an orange underline to indicate that it took longer than it perhaps should have, but is still OK
  • For a long page load, the request time will have a red underline to indicate that it is potentially dangerously slow

The threshold for a dangerously slow page load can be configured with the DebugBar.warn_request_time_seconds configuration setting.

The threshold for a slower/warning level indicator is defined as a percentage of the dangerous threshold (by default, 50%). This can be adjusted by modifying the DebugBar.warn_warning_ratio configuration setting.

Helper methods

Quick debugging

The d() function helps you to quickly debug code. It will use the Symfony VarDumper to display the data in a "pretty" way.

In an XHR/AJAX context, it will simply display the data in a more simple fashion.

When d() is called without arguments, it will display all objects in the debug backtrace. It will display the variable name before its content to make it easy to identify data amongst multiple values.

d($myvar, $myothervar);

Any call to d() with "sql" in the name of the variable will output a properly formatted SQL query, for instance:

d($myDataList->sql());

Quick logging

The l() function helps you to log messages, and since they will appear in the "Messages" tab, it is very useful.

l('My message');

Configuration options

Wherever possible, features and settings have been made configurable. You can see a list of the default configuration settings by looking at _config/debugbar.yml. To modify any of these settings you can define a YAML configuration block in your mysite/_config folder, for example:

mysite/_config/debugbar.yml:

---
Name: mysitedebugbar
---
LeKoala\DebugBar\DebugBar:
  enabled_in_admin: false
  query_limit: 500

Settings

Setting Type Description
enable_storage bool Store all previous request in the temp folder (enabled by default)
auto_debug bool Automatically collect debug and debug_request data (disabled by default)
ajax bool Automatically inject data in XHR requests (disabled by default, since this makes the Chrome request inspector very slow due to the large amount of header data)
check_local_ip bool Do not display the DebugBar if not using a local ip (enabled by default)
find_source bool Trace which file generates a database query (enabled by default)
enabled_in_admin bool enable DebugBar in the CMS (enabled by default)
include_jquery bool Let DebugBar include jQuery. Set this to false to include your own jQuery version
query_limit int Maximum number of database queries to display (200 by default for performance reasons)
warn_query_limit int Number of database queries before a warning will be displayed
performance_guide_link string When a warning is shown for a high number of DB queries, the following link will be used for a performance guide
warn_dbqueries_threshold_seconds int Threshold (seconds) for how long a database query can run for before it will be shown as a warning
warn_request_time_seconds int Threshold (seconds) for what constitutes a dangerously long page request (upper limit)
warn_warning_ratio float Ratio to divide the warning request time by to get the warning level (default 0.5)
show_namespace bool Show the fully qualified namespace in the Database tab when set to true. Defaults to false
db_collector bool Show the db tab. Defaults to true
db_save_csv bool Save queries to csv in the temp folder. Use ?downloadqueries to download current. Defaults to false
config_collector bool Show the config tab. Defaults to true
cache_collector bool Show the cache tab. Defaults to true
cache_collector_show_get bool Display get calls in cache tab. Defaults to false
partial_cache_collector bool Show the partial cache tab. Defaults to true
email_collector bool Show the email tab. Defaults to true
header_collector bool Show the headers tab. Defaults to true

Disabling the debug bar

You can disable the debug bar with PHP or configuration:

putenv('DEBUGBAR_DISABLE=true');
LeKoala\DebugBar\DebugBar:
  disabled: true

Troubleshooting

Using Vagrant

If you are using Vagrant (or presumably Docker or other virtualisation) and the DebugBar isn't showing up, make sure you have the check_local_ip config option set to false. This is due to the way Vagrant and Virtualbox configure networking by default.

Managing jQuery

The DebugBar will include its own version of jQuery by default. It will only be disabled in the admin (which already use jQuery).

If you have added jQuery in your requirements the DebugBar will not load its own jQuery version (if the filename is jquery.js or jquery.min.js). You can also set the following configuration flag to false to prevent the DebugBar from including its own jQuery.

LeKoala\DebugBar\DebugBar:
  include_jquery: false

If you are including jQuery yourself, it is expected you include it in Page::init(). Below is an example of how to the jQuery which ships with the framework:

protected function init()
{
    parent::init();
    Requirements::javascript('framework/thirdparty/jquery/jquery.min.js');
}

When using the simple theme, you probably want to disable the jquery from the cdn.

protected function init()
{
    parent::init();
    Requirements::block("//code.jquery.com/jquery-3.3.1.min.js");
}

If you include jQuery during an action, you need to call DebugBar::suppressJquery();. This will move all our scripts after your own, which should include Jquery first.

public function my_action()
{
    DebugBar::suppressJquery();
    Requirements::javascript("//code.jquery.com/jquery-3.3.1.min.js");
    Requirements::javascript("my.plugin.js");

    return $this;
}

FulltextSearchable support

It has been reported that the FulltextSearchable extension conflicts with the config_collector.

If you happen to have an issue (eg: your $SearchForm not being printed), please disable the config_collector.

A quick note about the Security Page

LeKoala\DebugBar\Extension\ControllerExtension will include for you all the required assets for DebugBar.

This is done using the onAfterInit extension hook, however on the Security controller the onAfterInit is called before your init() method in the PageController.

Since you need to add jQuery before DebugBar this may be a problem, and therefore requirements will NOT be included on the Security controller.

If you want DebugBar to work on the Security controller, make sure to include all relevant requirements by calling DebugBar::includeRequirements(); after you include jQuery. When DebugBar is disabled this call will be ignored. Also note that any subsequent call to this method will be ignored as well.

Customize DebugBar css

Any customisation to the default css (as stored in "assets") should be made to css/custom.css. This file will be appended to the default css.

More than one body

If you more than one body tag, the middleware will fail to insert properly the required scripts. If that happens, you can use the placeholder in your page template. This is where the scripts will be inserted.

*903 upstream sent too big header

When using nginx you can run into this error. This is due to the proxy_buffer being to small to send all response headers.

The recommended config on official guide is:

location /index.php { fastcgi_buffer_size 32k; fastcgi_busy_buffers_size 64k; fastcgi_buffers 4 32k; ... }

You can tweak the settings like so (adjust the values depending on your needs):

location ~ .php$ { fastcgi_buffer_size 1024k; fastcgi_busy_buffers_size 2048k; fastcgi_buffers 4 1024k; ... }


Maintainer

LeKoala - [email protected]

License

This module is licensed under the MIT license.

silverstripe-debugbar's People

Contributors

adrhumphreys avatar andrewandante avatar andrewnick avatar callan-stretton avatar chillu avatar dizzystuff avatar djmattski avatar emteknetnz avatar firesphere avatar fspringveldt avatar guysartorelli avatar jakubdolba avatar jareddreyerss avatar lekoala avatar pine3ree avatar raissanorth avatar robbieaverill avatar sabina-talipova avatar sachajudd avatar scott1702 avatar torleif avatar wernerkrauss avatar zazama avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverstripe-debugbar's Issues

Remove CSS file widget.css

I've noticed the widget.css file was added back. We removed it previously because it was overriding the core package and moved everything to our own extension stylesheet. javascript/sqlqueries/widget.css

Commit

Remove NullHandler and only handle logs up to and including warning

The assumption that we can handle and log error levels and above and have them not halt page execution is incorrect with PSR-3.

The currently NullHandler override of the core logger ends up producing a white screen whenever errors are thrown.

We need to remove the handler and handling for log messages with those levels.

Tooltip visibility

Tooltips get an opacity of 70%, making them pretty unreadable. Standard 100% would probably do fine

Separate core php-debugbar assets from customisations

To make way for pre-processed assets (e.g. #53).

Currently the assets/debugbar.css for example has some customisations. We should use a location that is obvious that it's a third party file that shouldn't be touched.

Acceptance criteria

  • Latest version of php-debugbar's assets are copied through to assets/vendor/php-debugbar
  • Customisations to assets/debugbar.css as well as the other CSS and Javascript files in that folder are moved to a new folder (e.g. css/)
  • Documentation makes it easy for devs to find out which files to change when contributing

Enable TravisCI, Scrutinizer and Codecov.io

Hey @lekoala :)

As this module now has Travis configuration which runs Codecov.io code coverage, could you enable TravisCI and ScrutinizerCI? Codecov.io should enable automatically once a successful coverage run on Travis completes.

supply tagged version please

It would be great if you could supply a tagged version according with a changelog.

This way it's easier for composer to cache the package.

Also requirement of original debugbar as * is quite unstable if that package has a non-BC major version.

Consolidate docs?

@robbieaverill Thanks for writing awesome docs! I do wonder if they're a bit too scattered though - it's quite likely that devs will miss essential docs because they're spread across a dozen pages. Could we condense this into the README? I think in general, anchor links plus a long README are preferrable to mini-pages with half a screen of content. That definitely has it's limits, e.g. the GraphQL module README has grown too large. But in general, there's a lot of power in the ability to skim read by scrolling, and use browser search on a single page.

Capture and incorporate ?debug and ?debug_request

It would be nice if the Request-tab would include the output from ?debug and ?debug_request url variables.
I understand that this is not very easy to incorporate, but I think it would add a lot of value.

Memory leak in 1.0.0

I've identified that somewhere between v1.0.0-beta1 and v1.0.0, a regression has been introduced which results in severe memory leakage during long-running processes - particularly visible in my case during large unit test runs.

Unfortunately I don't have a deep understanding of the module's underpinnings, so I can't give any further detail on what is causing the issue. Should be able to reproduce this by running a large volume of DB queries on a CLI process and observing the difference in memory usage between 1.0.0-beta1 and 1.0.0.

[IMPROVEMENT] Display cached variables

It would be awesome to display cached variables: name, value, ttl

use SilverStripe\Core\Cache\FilesystemCacheFactory;
...
$cache = new FilesystemCacheFactory('data');
$this->cache = $cache->create('EventsAPI');
$this->cache->set('token', 'test', 3600);

composer require error

Hi if you use as suggested install method - it throws error like this because it is gonna try to add 1.1-dev

composer require --dev lekoala/silverstripe-debugbar

lekoala/silverstripe-debugbar 1.1.x-dev requires silverstripe/framework ~3.2 

My silverstripe is 4.0.0 - So I just used.

"lekoala/silverstripe-debugbar":"dev-master"

Icons don't make much sense

I feel the currently used icons are not really the best choice. Here's my thought:

  • database is a more sensible icon for database
  • list for Parameters?
  • envelope for Messages
  • cookie (Not yet available :( ) for cookies (duh)
  • file-code-o for templates
  • check for Requirements? (this is a tricky one)

How to show this bar?

I am confused about the usage of this module. After install it via composer, it didn't show up automatically, even when request with "debug" and "debug_request".

Is there any step I need go through to make this module work? Maybe I need to change some configurations?

Problems with own jquery

On my setup i block standard (old) jquery but use my own which i include when rendering the templates.

Unfortunately debugbar wants to inject the javascript before my own jquery is put to requirements, so it's called before and voila - ReferenceError: jQuery is not defined

For now i have to inject my own jquery in Page_Controller::init to get debugbar work, another approach to inject required javascript as late as possible would be great.

Maybe RequestFilter could work? https://docs.silverstripe.org/en/3.3/developer_guides/controllers/requestfilters/

Deprecate/remove DebugBarDatabaseProxy

For feedback

DebugBarDatabaseProxy is SS 3.1 compatible, and DebugBarDatabaseNewProxy is SS 3.2+ compatible. It might be a good idea to set the minimum version requirement for this module to 3.2, deprecate the DebugBarDatabaseProxy class in the 0.x release line and remove it in 1.0.x to reduce duplication and maintenance burden.

I'm sure that there are still plenty of users on 3.1, but it's been EOL for some time now (current minimum supported version is 3.5).

Fatal error: Call to a member function getTitle() on null

I'm getting this error.
I'm using PHP 5.6
Mac OSX
Apache 2.4
Silverstripe 3.6.1

I ran multiple flushes, with no change.
Uninstall and flush again, and the site works again.

Fatal error: Call to a member function getTitle() on null in .../debugbar/code/DebugBarSilverStripeCollector.php on line 174
--

1 | 0.0006 | 240496 | {main}( ) | ../main.php:0
2 | 4.7042 | 7525160 | Director::direct( ) | ../main.php:191
3 | 131.4706 | 23252328 | RequestProcessor->postRequest( ) | ../Director.php:183
4 | 131.4707 | 23252552 | DebugBarRequestFilter->postRequest( ) | ../RequestProcessor.php:42
5 | 131.4707 | 23252672 | DebugBar::renderDebugBar( ) | ../DebugBarRequestFilter.php:57
6 | 131.4707 | 23254512 | DebugBar\JavascriptRenderer->render( ) | ../DebugBar.php:226
7 | 131.4707 | 23254808 | DebugBar\JavascriptRenderer->getJsInitializationCode( ) | ../JavascriptRenderer.php:981
8 | 131.4708 | 23255144 | DebugBar\JavascriptRenderer->getJsControlsDefinitionCode( ) | ../JavascriptRenderer.php:1015
9 | 131.4710 | 23268080 | DebugBarSilverStripeCollector->getWidgets( ) | ../JavascriptRenderer.php:1059

Any ideas on how to fix?

[BUG] silverstripe-cache dir is missing

[Emergency] Uncaught UnexpectedValueException: DirectoryIterator::__construct(/srv/dist/web/silverstripe-cache/www-data/debugbar/): failed to open dir: No such file or directory
GET /?flushtoken=4bcb6cc6cb95cdc471d385737ce2aca5&flush=
Line 113 in /srv/dist/web/vendor/maximebf/debugbar/src/DebugBar/Storage/FileStorage.php

Cant seem to get working on Website Fontend

Hi There,

Just seem to be having an issue getting this working on the front end of the website (admin shows find). I am including my own jQuery, the required CSS/JS from debug bar is loaded, and when I try to debug the DebugBar using in my Page Controller init() function:

$foo = DebugBar::WhyDisabled();
d($foo);

The returned result is 'I don't know why'

There are no errors that I can see being logged (both JS/PHP)

If I can supply you with any useful info I can..

Using SilverStripe 3.5

Release 1.0.0

Hey @lekoala

With the completed merge of the following PRs, the module seems to be stable enough for a 1.0.0 release - what do you think?

The last step would probably be to flesh our the documentation for this module a little more and include some screenshots etc, which I am working on at the moment. I'll push a pull request when it's done.

Our team will be looking at upgrading this for SS4 in the next week or two as well adding a couple of new features which are not really doable in SS3.

Any thoughts on this?

No tests

Tests are missing. I think adding either Behat or Unit tests would be a good thing to make sure everything stays stable.

config_collector disables FulltextSearchable

Versions

silverstripe/cms => 4.3.3
lekoala/silverstripe-debugbar => 2.0.3

Problem

Enabling config_collector disabled the Search extension.

Information

I just installed silverstripe-debugbar on a SilverStripe installation based on silverstripe/recipe-cms 4.3 with FulltextSearchable::enable(), and noticed that my $SearchForm was not being printed.

I have not dug much into it, but seems like config_collector modifies the configurations disabling the search extension.
After disabling config_collector, the Search functionality came back.

The results from d(ContentController::get_extensions()) where different after enabling config_collector

Strict Notice with SS3.5.0

I got this after updating from SS 3.4.1 to 3.5:

[Strict Notice] Declaration of DebugBarDatabaseNewProxy::benchmarkQuery() should be compatible with SS_Database::benchmarkQuery($sql, $callback, $parameters = Array)

Silverstripe 4.1

Doesn't this work with Silverstripe 4.1? I'm getting errors when running the site after installing this:

[Emergency] Uncaught SilverStripe\Core\Injector\InjectorNotFoundException: ReflectionException: Class Psr\SimpleCache\CacheInterface.cacheblock does not exist in /Library/WebServer/Documents/rtv_ss4/vendor/silverstripe/framework/src/Core/Injector/InjectionCreator.php:17 Stack trace: #0 

Trace
SilverStripe\Core\Injector\InjectionCreator->create(Psr\SimpleCache\CacheInterface.cacheblock, Array) 
Injector.php:585
SilverStripe\Core\Injector\Injector->instantiate(Array, Psr\SimpleCache\CacheInterface.cacheblock, singleton) 
Injector.php:988
SilverStripe\Core\Injector\Injector->getNamedService(Psr\SimpleCache\CacheInterface.cacheblock, 1, Array) 
Injector.php:941
SilverStripe\Core\Injector\Injector->get(Psr\SimpleCache\CacheInterface.cacheblock) 
SSViewer.php:558
SilverStripe\View\SSViewer->getPartialCacheStore() 
SSViewer.php:596
SilverStripe\View\SSViewer->includeGeneratedTemplate(/Library/WebServer/Documents/rtv_ss4/silverstripe-cache/_www/.cachevendor.silverstripe.assets.templates.SilverStripe.Assets.Flysystem.PublicAssetAdapter_HTAccess.ss, SilverStripe\View\ArrayData, , Array, ) 
SSViewer.php:674
SilverStripe\View\SSViewer->process(SilverStripe\View\ArrayData, , ) 
SSViewerProxy.php:36
LeKoala\DebugBar\Proxy\SSViewerProxy->process(SilverStripe\View\ArrayData) 
AssetAdapter.php:191
SilverStripe\Assets\Flysystem\AssetAdapter->renderTemplate(SilverStripe\Assets\Flysystem\PublicAssetAdapter_HTAccess) 
AssetAdapter.php:154
SilverStripe\Assets\Flysystem\AssetAdapter->configureServer(1) 
AssetAdapter.php:120
SilverStripe\Assets\Flysystem\AssetAdapter->flush() 
FlysystemAssetStore.php:897
SilverStripe\Assets\Flysystem\FlysystemAssetStore::flush() 
FlushMiddleware.php:22
SilverStripe\Control\Middleware\FlushMiddleware->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
RequestProcessor.php:66
SilverStripe\Control\RequestProcessor->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
SessionMiddleware.php:20
SilverStripe\Control\Middleware\SessionMiddleware->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
AllowedHostsMiddleware.php:60
SilverStripe\Control\Middleware\AllowedHostsMiddleware->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
TrustedProxyMiddleware.php:176
SilverStripe\Control\Middleware\TrustedProxyMiddleware->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\Director->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
HTTPMiddlewareAware.php:65
SilverStripe\Control\Director->callMiddleware(SilverStripe\Control\HTTPRequest, Closure) 
Director.php:370
SilverStripe\Control\Director->handleRequest(SilverStripe\Control\HTTPRequest) 
HTTPApplication.php:48
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest) 
call_user_func(Closure, SilverStripe\Control\HTTPRequest) 
HTTPApplication.php:66
SilverStripe\Control\HTTPApplication->SilverStripe\Control\{closure}(SilverStripe\Control\HTTPRequest) 
call_user_func(Closure, SilverStripe\Control\HTTPRequest) 
ErrorControlChainMiddleware.php:56
SilverStripe\Core\Startup\ErrorControlChainMiddleware->SilverStripe\Core\Startup\{closure}(SilverStripe\Core\Startup\ErrorControlChain) 
call_user_func(Closure, SilverStripe\Core\Startup\ErrorControlChain) 
ErrorControlChain.php:236
SilverStripe\Core\Startup\ErrorControlChain->step() 
ErrorControlChain.php:226
SilverStripe\Core\Startup\ErrorControlChain->execute() 
ErrorControlChainMiddleware.php:69
SilverStripe\Core\Startup\ErrorControlChainMiddleware->process(SilverStripe\Control\HTTPRequest, Closure) 
HTTPMiddlewareAware.php:62
SilverStripe\Control\HTTPApplication->SilverStripe\Control\Middleware\{closure}(SilverStripe\Control\HTTPRequest) 
HTTPMiddlewareAware.php:65
SilverStripe\Control\HTTPApplication->callMiddleware(SilverStripe\Control\HTTPRequest, Closure) 
HTTPApplication.php:67
SilverStripe\Control\HTTPApplication->execute(SilverStripe\Control\HTTPRequest, Closure, 1) 
HTTPApplication.php:49
SilverStripe\Control\HTTPApplication->handle(SilverStripe\Control\HTTPRequest) 
index.php:26

Show the result of a key

Using "click to see fields", (besides it could be a tiny bit more nicely formatted :P ), it would be awesome if it showed the results of the query in the table?
At least, when it's a limit 1 query?

Certain SS_Database manipulations passes array to DebugBarDatabaseNewProxy__constructor()

2 examples thereof reside within silverstripe/auditor and silverstripe/fulltextsearch modules.
This causes an issue with DebugBarDatabaseNewProxy::__construct() which expects a MySQLDatabase object parameter.

Steps to reproduce:

  1. Set up a vanilla ss3 install composer create-project silverstripe/installer ss3
  2. Install auditor module composer require silverstripe/auditor or composer require silverstripe/fulltextsearch
  3. Install debugbar composer require lekoala/silverstripe-debugbar
  4. dev/build and flush, then when visiting the front-end of your new site the below error is produced

silverstirpe/auditor example:
image

silverstripe/fulltextsearch example:
image

Should it work with ss3.6.2 on php7.1?

Hi,
Can't get it working on ss3.6.2 on php7.1, not in frontend and not in admin. Environment is dev (setting in _ss_environment.php).
Should it work with this combination?

[BUG] too big header at the CMS

Getting an error from nginx when debugbar enabled at the CMS

2018/05/29 00:14:35 [error] 15667#15667: *903 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: *.run.local.pro, request: "GET /admin/pages/treeview HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "run.local.pro", referrer: "http://run.local.pro/admin/pages/"

Add ability to show when a template cache was hit/missed

It’s often hard to tell from the outside if you’re writing an effective cache key. You can guess if e.g. a partial template cache applies by looking at the overall page load time, but that’s not very accurate. Or you can set a breakpoint in the logic that should be cached, which in reality is too much of a barrier and gets easily missed. If the toolbar told you “Your partial cache named ‘myCacheKey’ didn’t find any existing caches”, it’s much clearer

Stable release

The master branch of this module supports SS4 but there's no tagged release. Any idea when this will happen?

Show only duplicate queries

Although it highlights which queries are apparently duplicates, it would be nice to filter them by "duplicate only" and grouped by statement, to see where there could be some optimisations.

Javascript bindToJquery Error in debugbar.js Line 1115

Silverstripe: 4.1.2
Php: 7.1.12
Jquery: 3.3.1
Silverstripe-debugbar: 2.x-dev and others

i get a javascript error on the front end - not in the cms and can't figure out why:

Line: 1115: undefined is not a function (near '...jq(document).ajaxComplete...')

PHP 7.2 upgrade

Is there any plans to make this compatible with 7.2. I notice there is a Object extends in DebugBar.php. Would this be the only amend to get it working with 7.2??

Destroying the session causes an error

When logging out, or just manually destroying the session, the SilverStripeCollector attempts to loop over a null result of getting the session, causing a Warning to be thrown.

screenshot_2018-10-24 get

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.