Path

ez projects / ggsysinfo / forum / general / [ini value debug] comment w...


[Ini Value Debug] comment with a semicolons

You need to be logged in to post messages in the forums. New users may register here.

Adrien Loyant

Member since:
16 June 2011

Posts: 2

Tuesday 03 April 2012 6:24:18 pm

Hi,

First of all, thanks for sharing your extension with the community.
I've notice that there is an alert when a line seems not to be a comment or a block one.
Good for us, but if we check how to comment a line in a ini file, it's with a semicolons
;
instead of a sharp
#
which is the old syntax (http://en.wikipedia.org/wiki/INI_file).

Is that possible to change the regular expression to fix this?
Thank you and good luck :)

One step closer... The best is yet to come.

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Tuesday 03 April 2012 6:34:34 pm

I'll have to check the eZ sources - what they think is a valid comment might be different from what wikipedia thinks about the "standard" format for ini files...

Principal Consultant International Business
Member of the Community Project Board

Up

Alexandre SEBBANE

Member since:
08 September 2007

Posts: 19

Tuesday 03 April 2012 8:31:48 pm

in the ezini class , comment are recognized with : #

so we can use wikipedia but we have to modify first ezpublish : that is not the aim of this extension.

Alex

Paris, France

Up

Adrien Loyant

Member since:
16 June 2011

Posts: 2

Wednesday 04 April 2012 11:28:36 am

Oh dear! You're right about the kernel ;). But if the extension recommends the use of php 5.4 while eZ System recommends php 5.3, I just imagined that extension was warning about various "best practices".
If you check the ini parser all text that is not a section or a variable is considered as a comment. The sharp symbol allow to optimized the loop. There is just a (real) problem about the double sharp when we comment a section/variable on the same line :).
By the way, this is not wikipedia thinking (I put the wiki links because we can access to references), this is how "should" normally work the comments in ini files. For example, if you use a sharp to comment an apache ini config file, on a correct unix server, it will throw an alert. It was what I meant.
So, all my apologies if I've mis-understanding a part of the extension's aim. My bad!

Good luck, best wishes.

One step closer... The best is yet to come.

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Sunday 12 August 2012 5:55:08 pm

@Adrien, the aim of the extension is indeed to recommend "best practices" - but the primary goal is to help devs and sysadmins in their daily work.

I think here we are splitting hairs in 4...

As you said the ini parser just ignores anything which does not conform to "block" or "value".
I do highlight anything which looks "suspicious" for a single reason: I've spent too many hours of my life debugging eZ where the error was a spurious character (esp. tab or whitespace) in an ini file. And I know many fellow developers have the same problem.

I never personally used semicolon for comments in my own ini files, and as far as I can see neither did Alexandre, so at the moment it looks like it is not a common practice.
But if there are more developers voicing support for semicolon-based comments, I'm all for not marking it as "dubious"

Principal Consultant International Business
Member of the Community Project Board

Up

You need to be logged in to post messages in the forums. New users may register here.