Show
Ignore:
Timestamp:
11/14/07 13:13:23 (14 months ago)
Author:
ppetermann
Message:

making Doctrine::dump() indent arrays

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r3138 r3155  
    977977     * @param mixed $var        a variable of any type 
    978978     * @param boolean $output   whether to output the content 
     979     * @param string $indent    indention string 
    979980     * @return void|string 
    980981     */ 
    981     public static function dump($var, $output = true) 
     982    public static function dump($var, $output = true, $indent = "") 
    982983    { 
    983984        $ret = array(); 
     
    985986            case 'array': 
    986987                $ret[] = 'Array('; 
     988                $indent .= "    "; 
    987989                foreach ($var as $k => $v) { 
    988                     $ret[] = $k . ' : ' . self::dump($v, false); 
     990                     
     991                    $ret[] = $indent . $k . ' : ' . self::dump($v, false, $indent); 
    989992                } 
    990                 $ret[] = ")"; 
     993                $indent = substr($indent,0, -4); 
     994                $ret[] = $indent . ")"; 
    991995                break; 
    992996            case 'object':