Download the PHP package dotkernel/dot-debugbar without Composer

On this page you can find all versions of the php package dotkernel/dot-debugbar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dot-debugbar

dot-debugbar

[!IMPORTANT] dot-debugbar is a wrapper on top of maximebf/php-debugbar

OSS Lifecycle

dot-debugbar badges

OSS Lifecycle PHP from Packagist (specify version)

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov docs-build

SymfonyInsight

Install

Install dot-debugbar in your application by running the following command:

composer require dotkernel/dot-debugbar

Setup

Once installed, the following components need to be registered by adding:

Locate the library's assets directory, called assets and copy its contents to your application under public/debugbar directory.

Locate the library's config file config/debugbar.local.php and clone it inside your application as:

By default, dot-debugbar is enabled only on the local environment, by whitelisting your local IP address in the config file, inside the array located under the ipv4Whitelist key. If you need to enable it on other environments as well, just whitelist your public IPV4 address. It can also be enabled globally, by whitelisting the string *. Finally, if you want to keep the whitelists but disable dot-debugbar, you can set enabled to false.

Inside the config file, you will find additional configurations under the javascript_renderer key. For more configuration values, follow the link in the related comment block.

At this step, dot-debugbar is not displayed yet. In order to display it, you need to call the following Twig functions from your base layout:

If you plan to enable dot-debugbar on production, make sure you clear the relevant cache items by deleting:

Additionally, you can check if dot-debugbar is enabled for your session by calling debugBarEnabled() inside a template. This feature can be useful if you need to add custom logic for when dot-debugbar is enabled.

Usage

Other than the data being automatically collected during a session, dot-debugbar can also be used to log messages, measure durations, debug database queries and more...

When you need an instance of DebugBar, locate an instance of it in your application's container using:

$debugBar = $container->get(\Dot\DebugBar\DebugBar::class);

then your factory can inject $debugBar as a dependency in your class.

OR

If you are using dot-annotated-services inject it directly in your class's constructor.

Once an instance of DebugBar has been injected in your code, you can access all its features. The below examples will assume you already have an instance of DebugBar in your code, and it's callable using $this->debugBar.

Logging messages

Results will show up in the debug bar under the Messages tab.

Log messages (can be of any type):

$this->debugBar->addMessage(1);
$this->debugBar->addMessage(true);
$this->debugBar->addMessage('foo');
$this->debugBar->addMessage(['foo']);
$this->debugBar->addMessage(new \stdClass());

Log messages and set custom label by specifying the 2nd argument (you can use any label, but error and warning use custom highlight and icons):

$exception = new \Exception('something went wrong');
$this->debugBar->addMessage($exception, 'error');
$this->debugBar->addMessage($exception->getMessage(), 'error');
$this->debugBar->addMessage('some warning', 'warning');
$this->debugBar->addMessage('custom message', 'custom');

Also, clicking on a label (found on the bottom right of the debugbar) will toggle the visibility of all messages with that specific label.

Measure durations

Results will show up in the debug bar under the Timeline tab.

In order to measure how long does it take for a piece of code to execute, do the following:

$this->debugBar->measure('long operation', function () {
    // your code here
});

OR

$this->debugBar->startTimer('long operation', 'measuring long operation');
// your code here
$this->debugBar->stopTimer('long operation');

Debug Doctrine queries

Results will show up in the debug bar under the Database tab.

By default, all queries executed in order to load a page will be logged and displayed under this tab. If you submit a form that will perform a redirect, you won't see the executed CREATE/UPDATE queries unless you stack the collected data:

$this->debugBar->stackData();

The method needs to be called after all database operations have finished AND before emitting the redirect response. In this case, next to the Memory usage widget you'll see a dropdown that allows you to select between the previous page load (with the redirect) and the current one.

Debug Exceptions

Results will show up in the debug bar under the Exceptions tab.

By registering Dot\DebugBar\Middleware\DebugBarMiddleware, dot-debugbar is ready to capture Exceptions.


All versions of dot-debugbar with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
doctrine/dbal Version ^2.13.9
doctrine/orm Version ^2.17.3
dotkernel/dot-twigrenderer Version ^3.4.2
laminas/laminas-stratigility Version ^3.11.0
maximebf/debugbar Version ^1.19.1
mezzio/mezzio Version ^3.18.0
psr/container Version ^1.1.2
psr/http-message Version ^1.1.0
twig/twig Version ^v3.19.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dotkernel/dot-debugbar contains the following files

Loading the files please wait ....