Symfony 2 uses the parse_ini_file () function and does not seem to return the correct type for a boolean.
<?php file_put_contents('test.ini', "test1=on\ntest2=true\ntest3=1"); var_dump(parse_ini_file('test.ini'));
displays
array(3) { 'test1' => string(1) "1" 'test2' => string(1) "1" 'test3' => string(1) "1" }
You might want to implement your own ini analyzer by taking Symfony\Component\DependencyInjection\Loader\IniFileLoader as an example.
An example of lexer that supports booleans can be found in the comments in the php doc for parse_ini_file ()
An alternative would be to use the yaml format for your configuration file.
source share