Skip to content

Commit

Permalink
Added dump for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jvitasek committed Apr 9, 2021
1 parent 717777e commit c985d2d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
function dd(...$args): void
{
foreach ($args as $x) {
Debugger::barDump($x);
if ('cli' === PHP_SAPI) {
dump($x);
} else {
Debugger::barDump($x);
}
}

die(1);
Expand Down
9 changes: 9 additions & 0 deletions tests/cli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

// run this file via CLI to test

use Tracy\Debugger;

require __DIR__ . '/../vendor/autoload.php';
Debugger::enable(Debugger::DEVELOPMENT);
dd('dump working');
4 changes: 3 additions & 1 deletion tests/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
<?php declare(strict_types = 1);

// run this file in browser to test

use Tracy\Debugger;

Expand Down

0 comments on commit c985d2d

Please sign in to comment.