Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
5d36a994
Commit
5d36a994
authored
Feb 18, 2015
by
alexpott
Browse files
Issue
#2174507
by jessebeach, alansaviolobo, tim.plunkett: Make debug() use print_r() by default
parent
1218fdf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/includes/common.inc
View file @
5d36a994
...
...
@@ -1662,10 +1662,10 @@ function _drupal_flush_css_js() {
* Label to prefix the data.
* @param $print_r
* Flag to switch between print_r() and var_export() for data conversion to
* string. Set $print_r to
TRUE when dealing with a recursive data structure
* as var_export() will generate an error.
* string. Set $print_r to
FALSE to use var_export() instead of print_r().
*
P
as
sing recursive data structures to
var_export() will generate an error.
*/
function
debug
(
$data
,
$label
=
NULL
,
$print_r
=
FALS
E
)
{
function
debug
(
$data
,
$label
=
NULL
,
$print_r
=
TRU
E
)
{
// Print $data contents to string.
$string
=
String
::
checkPlain
(
$print_r
?
print_r
(
$data
,
TRUE
)
:
var_export
(
$data
,
TRUE
));
...
...
core/modules/simpletest/src/Tests/SimpleTestTest.php
View file @
5d36a994
...
...
@@ -210,7 +210,7 @@ function stubTest() {
$this
->
assertNothing
();
// This causes the debug message asserted in confirmStubResults().
debug
(
'Foo'
,
'Debug'
);
debug
(
'Foo'
,
'Debug'
,
FALSE
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment