custom settings in ini files

Author Message

Damien Pobel

Tuesday 13 June 2006 12:58:28 am

For several project I need to store specific settings. I use my own section in ini files :

[MySection]
NewsByPage=10
Help[news]=you should do this
Help[forum]=you should do that

it works well with single values and array with textual keys but when I use numeric keys in array, my settings are corrupted.

Example :
I write this

[MySection]
NewsID[163]=189
NewsID[192]=202

and after some use, eZ publish rewrites my config like that :

[MySection]
NewsID[]=189
NewsID[]=202

Is it normal or a bug ?

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Kristof Coomans

Tuesday 13 June 2006 1:13:54 am

Hi Damien

This is normal. I would recommend you to use some kind of prefix for your keys:

[MySection]
NewsID[blabla_163]=189
NewsID[blabla_192]=202

Of course, replace "blabla" with something meaningful ;-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Damien Pobel

Tuesday 13 June 2006 2:10:02 am

thanks for the quick answer !

I tried another solution that seems to work properly, I create my own ini file where I put my custom settings. It seems that eZ publish doesn't rewrite this custom file, so my settings aren't corrupted.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

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

eZ debug

Timing: Jan 19 2025 01:03:13
Script start
Timing: Jan 19 2025 01:03:13
Module start 'layout'
Timing: Jan 19 2025 01:03:13
Module start 'content'
Timing: Jan 19 2025 01:03:14
Module end 'content'
Timing: Jan 19 2025 01:03:14
Script end

Main resources:

Total runtime1.4560 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 590.5859152.6250
Module start 'layout' 0.00760.0041 743.210939.4453
Module start 'content' 0.01161.4426 782.6563551.1328
Module end 'content' 1.45420.0018 1,333.789112.1641
Script end 1.4560  1,345.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2341160.0002
Check MTime0.00130.0918160.0001
Mysql Total
Database connection0.00130.091410.0013
Mysqli_queries1.396695.9208570.0245
Looping result0.00060.0403550.0000
Template Total1.419497.520.7097
Template load0.00220.149220.0011
Template processing1.417297.333420.7086
Template load and register function0.00010.006010.0001
states
state_id_array0.00090.059110.0009
state_identifier_array0.00170.116120.0008
Override
Cache load0.00180.1231230.0001
Sytem overhead
Fetch class attribute can translate value0.00070.045120.0003
Fetch class attribute name0.00140.095550.0003
XML
Image XML parsing0.00100.070520.0005
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00190.1272220.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs