*.ini files efficiency, good practices

Author Message

Piotrek Karaś

Thursday 15 May 2008 4:08:17 am

Few questions about technical details and good practices regarding use of *.ini configuration files.

1) When *.ini files are called for using ezini() operator in the templates, where do they reach? Directly to the filesystem locations, to cache files, or maybe to some memory resources?

2) Why isn't there ezini_group() operator (following what's available from eZ API methods)?

3) Should calling ezini() operator 10 times in a row be considered expensive? Or is that just getting prefetched resources?

4) If *.ini settings grabbed with ezini() operator are expensive, should it be avoided to use those in uncached parts of templates, the pagelayout for example?

Thanks,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

André R.

Thursday 15 May 2008 5:27:04 am

1) Currently: first time you call ezini for a specific ini file, it will check for the existence of this file with all four variants (ini, ini.php, ini.append and ini.append.php ) in all possible locations in all activated extensions, when it is done it will create cache file name based on this array of file paths and then compare last modifed time on all those files compares to the cache file.
Cache is read or generated and put into ini instance's local variable cache.
The next time the file is requested (during the same page request) it is read from local variable cache.

For a somewhat more performance related approach ('ezini_performance_full_pluss_devmode.diff'):
http://issues.ez.no/IssueView.php?Id=12137&activeItem=24

2) good question, just added it as operator in OE my self ('ezoe_ini_section')

3) see 1)

4) Depends, earlier ini settings where compiled into the template when the template where compiled (unless you specified the dynamic flag), but I'm not sure it does that in trunk right now.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Piotrek Karaś

Thursday 15 May 2008 6:37:48 pm

Thanks!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Maxime Thomas

Sunday 18 May 2008 10:43:58 pm

I've got another question concerning ini files :
Why eZSystems choose to put some reference data such as location data in an ini file rather than in a table ?

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.