From: Brion Vibber Date: Mon, 15 Nov 2004 00:15:58 +0000 (+0000) Subject: Spiff this up a bit: X-Git-Tag: 1.5.0alpha1~1328 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=db6c4af2716bdf984de450821eca75bfc134395d;p=lhc%2Fweb%2Fwiklou.git Spiff this up a bit: * output data returned by the eval; prints strings and numbers directly, var_dump()s arrays and objects * if no returned data, print a line break. This makes things easier when doing 'echo' and you forget to add one yourself. * Add some documentation comments --- diff --git a/maintenance/eval.php b/maintenance/eval.php index c53da36f90..9ef4958fbf 100755 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -1,6 +1,17 @@ " ); - eval( $line . ";" ); + $val = eval( $line . ";" ); + if( is_null( $val ) ) { + echo "\n"; + } elseif( is_string( $val ) || is_numeric( $val ) ) { + echo "$val\n"; + } else { + var_dump( $val ); + } if ( function_exists( "readline_add_history" ) ) { readline_add_history( $line ); } } while ( 1 ); - - - ?>