Source for file dump.php
Documentation is available at dump.php
* Dumps values of the given variable, or the entire data if nothing provided
* * var : the variable to display
* * show_methods : if set to true, the public methods of any object encountered are also displayed
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
public function process($var =
'$', $show_methods =
false)
$var =
$this->dwoo->getData();
$out =
'<div style="background:#aaa; padding:5px; margin:5px; color:#000;">data';
$out =
'<div style="background:#aaa; padding:5px; margin:5px; color:#000;">dump';
$scope =
$this->dwoo->getScope();
$out .=
' (current scope): <div style="background:#ccc;">';
$out .=
':<div style="padding-left:20px;">';
$out .=
$this->export($var, $scope);
return $out .
'</div></div>';
protected function export($var, $scope)
foreach ($var as $i=>
$v) {
$out .=
' (current scope):<div style="background:#ccc;padding-left:20px;">'.
$this->export($v, $scope).
'</div>';
$out .=
':<div style="padding-left:20px;">'.
$this->export($v, $scope).
'</div>';
return $i .
' [recursion, skipped]<br />';
$ref =
new ReflectionObject($obj);
foreach ($ref->getMethods() as $method) {
if (!$method->isPublic()) {
if (empty($out['method'])) {
foreach ($method->getParameters() as $param) {
$params[] =
($param->isPassedByReference() ?
'&':
'') .
'$'.
$param->getName() .
($param->isOptional() ?
' = '.
var_export($param->getDefaultValue(), true) :
'');
$out['method'] .=
'(method) ' .
$method->getName() .
'('.
implode(', ', $params).
')<br />';
foreach ($list as $attributeName =>
$attributeValue) {
} elseif(substr($attributeName, 0, 3) ===
"\0*\0") {
$attributeName =
substr($attributeName, 3);
$attributeName =
substr($attributeName, $protectedLength);
$out[$key] .=
'('.
$key.
') ';
$out[$key] .=
$attributeName.
' (array):<br />
<div style="padding-left:20px;">'.
$this->export($attributeValue, false).
'</div>';
$out[$key] .=
$this->exportObj($attributeName.
' (object: '.
get_class($attributeValue).
'):', $attributeValue);
$out[$key] .=
$this->exportVar($attributeName.
' = ', $attributeValue);
$return =
$i .
'<br /><div style="padding-left:20px;">';
if (!empty($out['method'])) {
$return .=
$out['method'];
if (!empty($out['public'])) {
$return .=
$out['public'];
if (!empty($out['protected'])) {
$return .=
$out['protected'];
if (!empty($out['private'])) {
$return .=
$out['private'];
return $return .
'</div>';
Documentation generated on Sun, 07 Feb 2010 17:53:33 +0000 by phpDocumentor 1.4.0