Mantis - Quercus
Viewing Issue Advanced Details
3878 major always 02-05-10 05:02 05-11-10 16:51
ice-breaker  
nam  
normal  
closed 4.0.2  
fixed  
none    
none 4.0.7  
0003878: parse_ini_file does not replace PHP Constants
Trying to install the Zend Framework i encountered an implementation issue in the parse_ini_file function.
By default PHP Constants inside the ini file should be replaced by their value, but quercus doesn't do it.
config.ini:
[group0]
val0 = VALUE
val2 = VALUE " is more than four"
val1 = VALUE is more than four
val3 = VALUE ' is more than four'
val4 = "VALUE is more than four"
VALUE = keys should not be replaced

php file:
<?php
define('VALUE', 5);
print_r(parse_ini_file('config.ini'));

expected output:
Array
(
    [val0] => 5
    [val2] => 5 is more than four
    [val1] => VALUE is more than four
    [val3] => VALUE ' is more than four'
    [val4] => VALUE is more than four
    [VALUE] => keys should not be replaced
)

actual output:
Array
(
    [val0] => 5
    [val2] => VALUE " is more than four"
    [val1] => VALUE is more than four
    [val3] => VALUE ' is more than four'
    [val4] => VALUE is more than four
    [VALUE] => keys should not be replaced
)

Notes
(0004417)
ice-breaker   
02-05-10 05:05   
correction: quercus DOES replace php constant BUT NOT on string concatenations (val2)
(0004564)
nam   
05-11-10 16:51   
php/164w