Source for file Dump.php
Documentation is available at Dump.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* Function and class to dump XML_RPC_Value objects in a nice way
* Should be helpful as a normal var_dump(..) displays all internals which
* doesn't really give you an overview due to too much information.
* @author Christian Weiske <cweiske@php.net>
* @version CVS: $Id: Dump.php 178076 2005-01-24 03:47:55Z danielc $
* @link http://pear.php.net/package/XML_RPC
* Pull in the XML_RPC class
require_once 'XML/RPC.php';
* Generates the dump of the XML_RPC_Value and echoes it
* @param object $value the XML_RPC_Value object to dump
echo $dumper->generateDump ($value);
* Class which generates a dump of a XML_RPC_Value object
* @author Christian Weiske <cweiske@php.net>
* @version Release: 1.5.2
* @link http://pear.php.net/package/XML_RPC
* The indentation array cache
* The spaces used for indenting the XML
* Returns the dump in XML format without printing it out
* @param object $value the XML_RPC_Value object to dump
* @param int $nLevel the level of indentation
* @return string the dump
PEAR ::raiseError ('Tried to dump non-XML_RPC_Value variable' . "\r\n",
return $this->getIndent($nLevel) . 'NOT A XML_RPC_Value: '
switch ($value->kindOf ()) {
$ret = $this->genArray($value, $nLevel);
$ret = $this->genScalar($value->scalarval (), $nLevel);
PEAR ::raiseError ('Illegal type "' . $value->kindOf ()
. '" in XML_RPC_Value' . "\r\n", 0 ,
* Returns the scalar value dump
* @param object $value the scalar XML_RPC_Value object to dump
* @param int $nLevel the level of indentation
* @return string Dumped version of the scalar value
* Returns the dump of a struct
* @param object $value the struct XML_RPC_Value object to dump
* @param int $nLevel the level of indentation
* @return string Dumped version of the scalar value
$strOutput = $this->getIndent($nLevel) . 'struct' . "\r\n";
while (list ($key, $keyval) = $value->structeach ()) {
$strOutput .= $this->getIndent($nLevel + 1 ) . $key . "\r\n";
* Returns the dump of an array
* @param object $value the array XML_RPC_Value object to dump
* @param int $nLevel the level of indentation
* @return string Dumped version of the scalar value
$nSize = $value->arraysize ();
$strOutput = $this->getIndent($nLevel) . 'array' . "\r\n";
for($nA = 0; $nA < $nSize; $nA++ ) {
$strOutput .= $this->getIndent($nLevel + 1 ) . $nA . "\r\n";
* Returns the indent for a specific level and caches it for faster use
* @param int $nLevel the level
* @return string the indented string
* c-hanging-comment-ender-p: nil
Documentation generated on Tue, 18 Aug 2009 17:30:02 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.
|