Re: best way to cache configs

From: Date: Sun, 03 Apr 2005 03:23:03 +0000
Subject: Re: best way to cache configs
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18493@lists.php.net to get a copy of this message
On 03/04/2005, at 12:32 PM, Ryan King wrote:
You're right, it is all by reference now. :-) Yeah, alot of classes use the pear static property stuff to manage their configuration (DB_Dataobject comes to mind). I'm not particularly a fan of that methodology, but it works. Of course, that stuff has to be setup on every request, just like everything else. Back to your Q's about caching, what is it that you're trying to avoid? Disk access? Parsing (of xml or ini)? Those are the two things I could imagine wanting to avoid. If you're looking to avoid the disc access, you'd have to use memcached or some such thing to cache your config in memory. If its the parsing overhead, look at either the phparray container or phpdefines container (warning: the phpdefines container is undocumented and not heavily tested).
Both disk access and parsing of the xml :) I want it in xml its much cleaner to edit. I have got all the settings for all the various packages like dataobjects into an xml file and not using the ini file at all :)

« previous php.pear.general (#18493) next »