For Programmers: Free Programming Magazines  


Home > Archive > PHP PEAR Questions and Answers > February 2006 > PEAR::Config suggestion









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PEAR::Config suggestion
James Carr

2006-02-08, 9:12 am

Hi,

I recently started using PEAR::Config due to it's description of using
XPath like searches, but ly found out this isn't true (for the most
part). For example, to get a path directive under 'Paths' with an
attribute name that equals 'root', I have to do the following
tomfoolery:

$directive =3D $conf->searchPath( array('Paths', array('path',
array('name' =3D> 'root'))));
echo $directive->getContent();

I think it would be nice to take some kind of XPath parser and use it
in a class that wraps Config_Container, allowing lookups like:
$directive =3D $conf->searchPath('/Paths/path[@name=3D"root"]');
echo $directive->getContent();

Thoughts?

Thanks,
JC
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com