English · Русский
The library needs no framework: everything here is a few lines or one file to copy. In every case
dws_debugger.json next to the project turns it on and off (see the README),
and without it nothing happens. Errors of the pages (jsTag()) need pushing to the
viewer; without it the tag is empty.
require __DIR__ . '/vendor/autoload.php'; // or require 'wapp-debugger.php', the one-file build
WappDebugger\Debugger::boot(__DIR__ . '/dws_debugger.json');as the first lines of the front controller (index.php) and of each CLI entry point. Before
</body> of the layout:
<?= WappDebugger\Debugger::instance()->jsTag() ?>Queries: WappDebugger\Sql::watch($pdo) for PDO, Debugger::instance()->sql() for anything else.
-
Start the request in
public/index.phpandartisan, right aftervendor/autoload.php:WappDebugger\Debugger::boot(__DIR__ . '/../dws_debugger.json'); // artisan: __DIR__ . '/dws_debugger.json'
-
A log channel in
config/logging.php, added to the stack (Laravel reports exceptions through the log, with their trace):'stack' => ['driver' => 'stack', 'channels' => ['single', 'wapp-debugger']], 'wapp-debugger' => ['driver' => 'custom', 'via' => WappDebugger\Bridge\LaravelChannel::class, 'level' => 'debug'],
-
Queries, in
AppServiceProvider::boot():Illuminate\Support\Facades\DB::listen(static function ($query): void { WappDebugger\Debugger::instance()->sql($query->sql, $query->bindings, $query->time); });
-
The tag of the pages, before
</body>of the layout:{!! WappDebugger\Debugger::instance()->jsTag() !!}.
Http:: of Laravel is Guzzle: Http::withMiddleware(WappDebugger\Bridge\GuzzleMiddleware::create()).
-
Start the request in
public/index.phpandbin/console, aftervendor/autoload_runtime.php:WappDebugger\Debugger::boot(dirname(__DIR__) . '/dws_debugger.json');
-
Copy
symfony/wapp_debugger.yamltoconfig/packages/(put it underwhen@dev:to keep it out of production). Every Monolog channel goes to the viewer; Doctrine logs its queries to thedoctrinechannel in dev. -
The tag of the pages, before
</body>ofbase.html.twig:{{ wapp_debugger.jsTag()|raw }}.
- Copy
wordpress/wapp-debugger.phptowp-content/mu-plugins/. - Put the library next to it as
wapp-debugger-library.php(the one-file build of a release), or install it with Composer in the site, or setWAPP_DEBUGGER_LIBRARYinwp-config.php. - Put
dws_debugger.jsoninto the site root (ABSPATH), or setWAPP_DEBUGGER_CONFIG.
Queries come with their time when define('SAVEQUERIES', true); is in wp-config.php. The tag of
the pages is printed in the footer of the site, of the admin and of the login page.
- Copy
bitrix/wapp-debugger.phpto/local/php_interface/, the library next to it aswapp-debugger-library.php(or install it with Composer and requirevendor/autoload.phpfirst). - At the top of
/local/php_interface/init.php:require __DIR__ . '/wapp-debugger.php'; - Put
dws_debugger.jsoninto the document root, or setWAPP_DEBUGGER_CONFIG.
Queries of the D7 connection come with their time (the old $DB uses it too); the tag of the pages
is put before </body> of every page.