Page 1 of 1

embed php code in ini file

Posted: Thu Aug 27, 2009 7:02 am
by bartfor
Hi there,

I was wondering if anyone has experience or ideas about using php code in ini files and parse them like You would with parse_ini_file() ?

Example config.ini

Code: Select all

 
[field1]
data1      = text
data2      = <?NOW();?>
data3      = <?dgettext('project1','hello_world')?>

Re: embed php code in ini file

Posted: Thu Aug 27, 2009 7:13 am
by Mark Baker
I wouldn't recommend it, you'll probably end up having to use eval() to parse it

Re: embed php code in ini file

Posted: Thu Aug 27, 2009 7:16 am
by bartfor
hmm, good suggestion, I'll give it at try, thanks