Var_Dump class modified
| From: | Frédéric Poeydomenge | Date: | Thu, 24 Jan 2002 14:52:54 +0000 |
| Subject: | Var_Dump class modified | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-4141@lists.php.net to get a copy of this message | ||
Hi,
I've made some modifications on the Var_Dump class, following your notices :
On Wed, 23 Jan 2002 19:42:24 +0100, "Martin Jansen" <mail@martin-jansen.de> wrote :
>Just one additional note to my posting this morning: Can
>you rename your class to Var_Dump since it then fits
>better in the PEAR naming scheme?
Done.
On Tue, 22 Jan 2002 15:16:46 +0100, Bertrand Mansion <bmansion@mamasam.com> wrote :
>I would just put a valign='top' in the cells.
Done.
On Wed, 23 Jan 2002 14:03:25 +0100, "Martin Jansen" <mail@martin-jansen.de> wrote :
>It looks nice and I think we should have something like that
>in PEAR. Just one point: Can we make the way of abstracting
>data in the HTML table just a little bit more abstract
>(different table border, cellpadding, font type etc.)?
I've added some bits of code to change the graphical rendering of the data :
http://frederic.poeydomenge.free.fr/vardump/graphics.php
You can use a kind of 'skin', or modify directly your parameters.
On Tue, 22 Jan 2002 15:52:38 +0100, "Karsten Kraus" <Karsten.Kraus@swr3.de> wrote :
>As the class does only search in the GLOBALS array, local vars (e. g. inside
>a function) and class-vars ($this->myVar) won't be found and thus can't be
>displayed. So I have to "global-ize" the variable to debug it's value, which
>is not really a prob in most cases, but... ;-))
Now it also works inside a function, or a class, see :
http://frederic.poeydomenge.free.fr/vardump/infonction.php
Now you have to call the constructor directly with a variable :
Var_Dump::display($myvar); // and no more ("myvar")
To obtain this result I had to change the design of the code, and I found a
problem in the function _populate() : how can I detect if a variable is the
$GLOBALS variable :
'if ($variable==$GLOBALS)' does not work, it return the following error code
'Fatal error: Nesting level too deep - recursive dependency?'
Any idea how to solve this problem ? For the moment I check if the EGPCS arrays
are found within my variable, I don't know if it's the best solution...
--
Frederic Poeydomenge, <frederic.poeydomenge@free.fr>