Forums / Suggestions / Multiline comments in INI-files

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

eZ debug

Timing: Jan 18 2025 01:09:22
Script start
Timing: Jan 18 2025 01:09:22
Module start 'content'
Timing: Jan 18 2025 01:09:23
Module end 'content'
Timing: Jan 18 2025 01:09:23
Script end

Main resources:

Total runtime0.8660 sec
Peak memory usage4,096.0000 KB
Database Queries56

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.8438180.8359
Module start 'content' 0.00530.8583 769.6797534.1563
Module end 'content' 0.86350.0024 1,303.835942.1094
Script end 0.8660  1,345.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3993140.0002
Check MTime0.00130.1465140.0001
Mysql Total
Database connection0.00070.076110.0007
Mysqli_queries0.826095.3825560.0148
Looping result0.00060.0687540.0000
Template Total0.838796.820.4193
Template load0.00210.248220.0011
Template processing0.836596.592520.4182
Template load and register function0.00030.029610.0003
states
state_id_array0.00140.167010.0014
state_identifier_array0.00110.123020.0005
Override
Cache load0.00180.2091180.0001
Sytem overhead
Fetch class attribute can translate value0.00090.109620.0005
Fetch class attribute name0.00160.179230.0005
XML
Image XML parsing0.00060.071720.0003
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00080.0870190.0000
String conversion0.00000.000630.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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