List Info

Thread: PEAR::Config suggestion




PEAR::Config suggestion
user name
2006-02-08 15:07:18
Hi,

I recently started using PEAR::Config due to it's
description of using
XPath like searches, but sadly 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 = $conf->searchPath( array('Paths',
array('path',
array('name' => '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 = $conf->searchPath('/Paths/path[name="root"]');
echo $directive->getContent();

Thoughts?

Thanks,
JC

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

PEAR::Config suggestion
user name
2006-02-08 23:22:36
On Wed, 2006-02-08 at 09:07 -0600, James Carr wrote:
> Hi,
> 
> I recently started using PEAR::Config due to it's
description of using
> XPath like searches, but sadly 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 = $conf->searchPath( array('Paths',
array('path',
> array('name' => '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 = $conf->searchPath('/Paths/path[name="root"]');
> echo $directive->getContent();
> 
> Thoughts?

Sounds good, send us an implementation and I'll look at
adding it to the
Config package. Tho I must say doing something about that
named root
node is on my list of things to fix with Config. It's
already causing
problems with conversion to and from various formats,
especially the
generic xml one.

Adam
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )