cvs: pearweb /include pear-debug.php
| From: | Thomas V.V.Cox | Date: | Sun, 27 Jan 2002 16:18:04 +0000 |
| Subject: | cvs: pearweb /include pear-debug.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2177@lists.php.net to get a copy of this message | ||
cox Sun Jan 27 11:18:04 2002 EDT
Modified files:
/pearweb/include pear-debug.php
Log:
The PEAR Team debug functions
Index: pearweb/include/pear-debug.php
diff -u pearweb/include/pear-debug.php:1.2 pearweb/include/pear-debug.php:1.3
--- pearweb/include/pear-debug.php:1.2 Fri Dec 28 19:10:26 2001
+++ pearweb/include/pear-debug.php Sun Jan 27 11:18:04 2002
@@ -1,11 +1,16 @@
<?php
-
+/*
+ The PEAR Team debug functions
+ (this is too personal for having only one for all ;-)
+*/
+ /* Stig */
function pre_dump($var) {
print "<pre>";
var_dump($var);
print "</pre>";
}
+ /* Richard */
// Print Dump & Die
function pdd($var){
echo '<pre>';
@@ -14,6 +19,7 @@
exit;
}
+ /* Richard */
// Var Dump & Die
function vdd($var){
echo '<pre>';
@@ -21,4 +27,26 @@
echo '</pre>';
exit;
}
+
+ /* Tomas */
+ function printr($var, $exit = 0)
+ {
+ if ($var === false) {
+ $str = 'FALSE';
+ } elseif ($var === true) {
+ $str = 'TRUE';
+ } elseif ($var === null) {
+ $str = 'NULL';
+ } else {
+ ob_start();
+ print_r($var);
+ $str = ob_get_contents();
+ ob_end_clean();
+ $str = htmlentities($str);
+ }
+ echo '<pre>'.$str.'</pre>';
+ if ($exit) {
+ exit;
+ }
+ }
?>