Forums / Developer / Way to determine if ini setting exists?

Way to determine if ini setting exists?

Author Message

zurgutt -

Monday 08 May 2006 10:52:03 am

Using ezini() to read unexisting ini value will work but trigers error in logs. Doesnt seem to be any way to check for existence of value cleanly?

Certified eZ developer looking for projects.
zurgutt at gg.ee

Paul Borgermans

Monday 08 May 2006 1:04:16 pm

Hi Zurgutt

I think the error message (in the logs) is good anyway. If it is about "custom" ini settings, I would prefer explicit declarations instead of assuming a condition (like false) if it is not there.

Or can you be more specific?

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

zurgutt -

Monday 08 May 2006 1:34:04 pm

I control some extra privileges on per-usergroup, per-objectclass basis, like:

[PermitEdit]
PermitEdit_13_66=true

to show some controls on class 66 to group 13. Not feasible to have a line for every permutation, list would be very long and change often.

Actually i can see now that this is stupid and inefficient way to store and get this data, I was very beginner when coded that part ;)

But anyhow just to confirm: there is no function to check if ini setting is set by design, it is assumed to be there? And correct way to solve similar situation would be to use array to store list of defined setting names separately?

Certified eZ developer looking for projects.
zurgutt at gg.ee

Paul Borgermans

Monday 08 May 2006 1:39:25 pm

Yes/No,

There is no operator/function to check existence of ini variables.

Anyway, I would go with arrays instead of "weird" property names.

See you in Skien?

--paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

zurgutt -

Tuesday 09 May 2006 2:30:17 am

Aye, I'll be there.

Will be driving my battlestation through sweden from stockholm.

Certified eZ developer looking for projects.
zurgutt at gg.ee