-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented issue #457: var_dump() overloading for the commandline.
This is a continuation of the xdebug.cli_color argument. The code simply works the same but doesn't apply the ANSI symbols. Ought to work on Windows too, but haven't tested that as my dev environment is broken for it.
- Loading branch information
Showing
32 changed files
with
309 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--TEST-- | ||
Test for bug #457: var_dump() overloading from the command line | ||
--INI-- | ||
html_errors=0 | ||
xdebug.default_enable=1 | ||
xdebug.var_display_max_data=32 | ||
xdebug.var_display_max_children=4 | ||
xdebug.var_display_max_depth=2 | ||
xdebug.cli_color=2 | ||
--FILE-- | ||
<?php | ||
$array = array( | ||
"A very long string that should be cut off at 32 characters", | ||
array( | ||
"a test for the depth setting", | ||
array( | ||
"this should not show" | ||
) | ||
), | ||
"third element", | ||
"fourth element (still shows)", | ||
"fifth element (should not show)" | ||
); | ||
var_dump($array); | ||
|
||
$object = new stdClass; | ||
$object->prop1 = "A very long string that should be cut off at 32 characters"; | ||
$object->array = array( | ||
"a test for the depth setting", | ||
array( | ||
"this should not show" | ||
) | ||
); | ||
$object->prop3 = "third element"; | ||
$object->prop4 = "fourth element (still shows)"; | ||
$object->prop5 = "fifth element (should not show)"; | ||
var_dump($object); | ||
--EXPECTF-- | ||
[1marray[22m([32m5[0m) { | ||
[0] [0m=>[0m | ||
[1mstring[22m([32m58[0m) '[31mA very long string that should b[0m'... | ||
[1] [0m=>[0m | ||
[1marray[22m([32m2[0m) { | ||
[0] [0m=>[0m | ||
[1mstring[22m([32m28[0m) '[31ma test for the depth setting[0m' | ||
[1] [0m=>[0m | ||
[1marray[22m([32m1[0m) { | ||
... | ||
} | ||
} | ||
[2] [0m=>[0m | ||
[1mstring[22m([32m13[0m) '[31mthird element[0m' | ||
[3] [0m=>[0m | ||
[1mstring[22m([32m28[0m) '[31mfourth element (still shows)[0m' | ||
|
||
(more elements)... | ||
} | ||
[1mclass[22m [31mstdClass[0m#1 ([32m5[0m) { | ||
[32m[1mpublic[22m[0m $prop1 [0m=>[0m [1mstring[22m([32m58[0m) '[31mA very long string that should b[0m'... | ||
[32m[1mpublic[22m[0m $array [0m=>[0m [1marray[22m([32m2[0m) { | ||
[0] [0m=>[0m | ||
[1mstring[22m([32m28[0m) '[31ma test for the depth setting[0m' | ||
[1] [0m=>[0m | ||
[1marray[22m([32m1[0m) { | ||
... | ||
} | ||
} | ||
[32m[1mpublic[22m[0m $prop3 [0m=>[0m [1mstring[22m([32m13[0m) '[31mthird element[0m' | ||
[32m[1mpublic[22m[0m $prop4 [0m=>[0m [1mstring[22m([32m28[0m) '[31mfourth element (still shows)[0m' | ||
|
||
(more elements)... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--TEST-- | ||
Test for bug #457: var_dump() overloading from the command line | ||
--INI-- | ||
html_errors=0 | ||
xdebug.default_enable=1 | ||
xdebug.var_display_max_data=32 | ||
xdebug.var_display_max_children=4 | ||
xdebug.var_display_max_depth=2 | ||
xdebug.cli_color=1 | ||
--FILE-- | ||
<?php | ||
$array = array( | ||
"A very long string that should be cut off at 32 characters", | ||
array( | ||
"a test for the depth setting", | ||
array( | ||
"this should not show" | ||
) | ||
), | ||
"third element", | ||
"fourth element (still shows)", | ||
"fifth element (should not show)" | ||
); | ||
var_dump($array); | ||
|
||
$object = new stdClass; | ||
$object->prop1 = "A very long string that should be cut off at 32 characters"; | ||
$object->array = array( | ||
"a test for the depth setting", | ||
array( | ||
"this should not show" | ||
) | ||
); | ||
$object->prop3 = "third element"; | ||
$object->prop4 = "fourth element (still shows)"; | ||
$object->prop5 = "fifth element (should not show)"; | ||
var_dump($object); | ||
--EXPECTF-- | ||
array(5) { | ||
[0] => | ||
string(58) 'A very long string that should b'... | ||
[1] => | ||
array(2) { | ||
[0] => | ||
string(28) 'a test for the depth setting' | ||
[1] => | ||
array(1) { | ||
... | ||
} | ||
} | ||
[2] => | ||
string(13) 'third element' | ||
[3] => | ||
string(28) 'fourth element (still shows)' | ||
|
||
(more elements)... | ||
} | ||
class stdClass#1 (5) { | ||
public $prop1 => string(58) 'A very long string that should b'... | ||
public $array => array(2) { | ||
[0] => | ||
string(28) 'a test for the depth setting' | ||
[1] => | ||
array(1) { | ||
... | ||
} | ||
} | ||
public $prop3 => string(13) 'third element' | ||
public $prop4 => string(28) 'fourth element (still shows)' | ||
|
||
(more elements)... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a bit excited thinking this was in the recent
2.2.0rc1
release - but apparently it is not 😢535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It most definitely is. If you want colours you need to turn it on though with xdebug.cli_color=1
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... it seems (at least to me) as if the variable doesn't exist. Here is my output from
php -i
:... and the relevant section from my
php.ini
:535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derickr Let me know if there's any other debugging information you might need for this and I'll gladly post (either here or by creating an issue on the xDebug bug tracker).
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derickr Ahh... I was going based off of the commit message:
It would be nice if xDebug would check for the
ANSICON
environment variable and allow color coding on Windows.This is what Symfony2 does and I get nice colored output:
... Or really - it could just obey the
cli_color
variable and a note could be added to the documentation for Windows users.This is what PHPUnit does, for example.
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
535df90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, all set here: http://bugs.xdebug.org/view.php?id=794