Hy Joe,
gavin has already found the related code I was refferring to... (our new ZF
Demo which will be avaiable latest with 1.0).
Just one small thing to mention...
To improve speed within the locale subclasses you can also use only the
qualifier (f.e. "en") which speeds up the locale classes as not a whole
object has to be worked with to get data.
The only classes for which you need an locale object are Zend_Date and
Zend_Locale itself... but not it's subclasses. So it you are not in need of
this two classes you can speed your application by only using the locale
identifier string... but we are speaking of some microseconds
(0.0001-0.0005) as there is not much data within a locale object. ;-)
Greetings
Thomas
I18N Team Leader
----- Original Message -----
From: "Joe Kramer" <[EMAIL PROTECTED]>
To: "Zend Framework General" <[email protected]>
Sent: Monday, April 16, 2007 9:02 PM
Subject: Re: [fw-general] Zend_Locale: how to stop it load xml file on every
request?
What do you man by "bootstrap file as mentioned in the documentation"
? I couldn't find that, can you point please which chapter that is in?
On 4/17/07, Thomas Weidner <[EMAIL PROTECTED]> wrote:
Hy Joe,
A few things you should know:
Zend_Locale loads practically one or two xml files depending on your
locale
on it's initialisation.
These files are cached internally as long as the object exists.
And the object should be within bour bootstrap file as mentioned in the
documentation.
We have made internally tests...
Having the locale data within an cache is as fast as the actual approach.
Having array is also as fast because the time which is consumed in
related
to reading the file and not
the parsing itself.
Database has shown to be slower even as reading the xml file.
There is not difference because loading a file is loading a file
independent
of the content. The loading is what's taking the time.
The only practical thing would be to have the data within an memcache
which
gives you 0.001 seconds bonus... BUT then you would probably have the
complete ZF within an memcache because without the locale data the
complete
I18N core would not work anymore and only throw exceptions.
This was the reason why we did not include the possibility of having the
CLDR externally.
Greetings
Thomas
I18N Team Leader
----- Original Message -----
From: "Joe Kramer" <[EMAIL PROTECTED]>
To: "Zend Framework General" <[email protected]>
Sent: Monday, April 16, 2007 7:35 PM
Subject: [fw-general] Zend_Locale: how to stop it load xml file on every
request?
> Hello,
>
> Zend_Locale loads locale xml file on every initialisation.
> I want to optimise the performance as much as possible.
>
> Is it possible to make my own locale data provider, to supply locale
> data from array or cache xml in memcache or database ?
>
> Thanks.