Re: [fw-general] Persistant config

2007-08-02 Thread Dan Rossi

Matthew Weier O'Phinney wrote:



The registry is a singleton registry, and as such it is persistent for
the duration of the request -- but not *between* requests. Remember, PHP
is a shared nothing architecture.

  
Thats what I thought, the same question came up regards to the PEAR 
Config package aswell, need a way to prevent constant xml parsing as I 
prefer to use xml for configs. Maybe implementing it into a cache ?




Re: [fw-general] Persistant config

2007-08-02 Thread Matthew Weier O'Phinney
-- Dan Rossi [EMAIL PROTECTED] wrote
(on Thursday, 02 August 2007, 11:18 PM +1000):
 Matthew Weier O'Phinney wrote:
  The registry is a singleton registry, and as such it is persistent for
  the duration of the request -- but not *between* requests. Remember, PHP
  is a shared nothing architecture.

 Thats what I thought, the same question came up regards to the PEAR 
 Config package aswell, need a way to prevent constant xml parsing as I 
 prefer to use xml for configs. Maybe implementing it into a cache ?

How big are your config files? If they're not all that large, I doubt
that it's a lot of processing time. However, yes, you can very easily
cache config objects -- see Zend_Cache for documentation on this. 

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Persistant config

2007-08-02 Thread Nico Edtinger

[02.08.2007 15:18] Dan Rossi wrote:
Thats what I thought, the same question came up regards to the PEAR  
Config package aswell, need a way to prevent constant xml parsing  
as I prefer to use xml for configs. Maybe implementing it into a  
cache ?


quote
Why is there no $DomDocument-__serialize()?
* libxml2 is tweaked to the max for parsing data
* Serializing a binary form wouldn't improve speed
/quote
http://php5.bitflux.org/xmlonspeed/slide_31.php

Serializing your config won't make it faster. The only thing you  
could do is caching your config as array with APC, as it's able to  
store the zval IIRC.


nico


RE: [fw-general] Persistant config

2007-08-01 Thread Michael Raymond
Hi Dan,

To my understanding, the framework relies on the frontController instance
everytime a request is sent to the application, and since every request went
thru the bootstrap file then the config will get parsed each time.

Rgds,
Michael


 -Original Message-
 From: Dan Rossi [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 02, 2007 10:07 AM
 To: Zend Framework
 Subject: [fw-general] Persistant config
 
 hi there, sorry I should compile these, when i set a config 
 array from a config xml to a registry entry, is this a 
 persistant registry pointer across pages, ie the xml doesnt 
 get parsed each time ?
 
 $config = new Zend_Config_Xml('../application/config/config.xml',
 'staging');
 
 $registry = Zend_Registry::getInstance(); 
 $registry-set('config', $config);
 
 I have this in my bootstrap file.
 
 Let me know thanks.
 


---