Re: Conf: argue !

"Wim Niemans ri" <[email protected]>
Newsgroups gmane.comp.lib.binarycloud.devel
Organization Pb Solo
Message-ID <421E8978.12209.30DD604@localhost>

On 25 Feb 2005 at 1:11, Jean-Christophe Michel wrote:

> Wim Niemans ri wrote:
> >>var_dump does not create the right output and i do not know how buggy 
> >>value_dump is right now.
> > 
> > 
> > Your search - value_dump site:www.php.net - did not match any documents
> 
> value_dump is in r3/init/functions.php
> Written some months (years) ago when var_dump hanged in php.
> It's easy to test it and  be sure it works.
> I'm not opposed to serialization if it's not slower.

I do see now. Thanks for pointing me to it.

I misinterpreted the sentence completely.
The statement dissapproves var_dump and proposes another standard 
function. Well, that's what I thought. But value_dump in functions.php 
makes an intentional mess of the value: suitable for loggging.

I'll give an example of a config_value. It's coming from the kses_class 
and is used to process html in a cms. The array holds tags that are 
allowed; all others are stripped:

$_CONF['user_html'] = array ( 
    'p'     => array(),
    'b'     => array(),
    'i'     => array(),
    'u'     => array(),
    'a'     => array('href' => 1, 'title' => 1),
    'em'    => array(),
    'br'    => array(),
    'tt'    => array(),
    'hr'    => array(),
    'li'    => array(),
    'ol'    => array(),
    'ul'    => array(),
    'code'  => array(),
    'pre'   => array(),
    'big'   => array(),
    'small' => array(),
    'strike'=> array()
);

To my opinion it's stupid to have this array pathed out completely. It's 
an array and should go into one config_value. Serialized, exported of as 
plain php. Whatever.

Finally, if the complete conf::tree must be saved somewhere, you have to 
serialize it as an object. No other way.

wim niemans
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.