Multiline comments in INI-files

Author Message

Peter Rudolfsen

Thursday 12 August 2010 2:23:21 am

From what I know, this is not supported today. Is there any reason for this? It's probably quite easy to implement, and it would allow for more flexible INI files.

One of the use cases would be to have build scripts that comment out parts of the files based on where the application/installation is deployed.

Example:

This could be something in an INI-file. Then the build script would recognize the ?env tags, and then add a surrounding multiline comment around this block, based on what it's built for.

#?env development
 [DebugSettings]
 DebugOutput=enabled
 #env?

To this: (/* */ is just an example, it really could be anything. <!-- --> could also be used)

#?env development
 /*
 [DebugSettings]
 DebugOutput=enabled
 */
 #env?

Stupid idea, or something to take a closer look at?

André R.

Thursday 12 August 2010 5:03:13 am

We plan to use a different parser in the future, so we have no intent in adding features to our current regex parser that will prevent us from moving to a faster & better* / a lot faster** parsers in the future.

* http://ezcomponents.org/docs/tutorials/Configuration#ini-file-format
** http://no.php.net/parse_ini_file

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

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 18 2025 04:15:59
Script start
Timing: Jan 18 2025 04:15:59
Module start 'layout'
Timing: Jan 18 2025 04:15:59
Module start 'content'
Timing: Jan 18 2025 04:15:59
Module end 'content'
Timing: Jan 18 2025 04:15:59
Script end

Main resources:

Total runtime0.6351 sec
Peak memory usage4,096.0000 KB
Database Queries55

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9141152.6250
Module start 'layout' 0.00590.0031 740.539139.4609
Module start 'content' 0.00910.6232 780.0000529.0781
Module end 'content' 0.63230.0027 1,309.07818.1641
Script end 0.6350  1,317.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.7188160.0003
Check MTime0.00150.2309160.0001
Mysql Total
Database connection0.00070.110410.0007
Mysqli_queries0.586292.3121550.0107
Looping result0.00050.0847530.0000
Template Total0.605695.420.3028
Template load0.00220.338720.0011
Template processing0.603495.017220.3017
Template load and register function0.00020.028310.0002
states
state_id_array0.00080.127210.0008
state_identifier_array0.00090.146120.0005
Override
Cache load0.00180.2838180.0001
Sytem overhead
Fetch class attribute can translate value0.00070.104120.0003
Fetch class attribute name0.00140.217630.0005
XML
Image XML parsing0.00060.094920.0003
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00080.1217170.0000
String conversion0.00000.001540.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.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: 15
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs