parsing - PHP RAW INI parser fails to parse values correctly -
ini data looks this:
[datasources] live.dsn = "mysql:host=localhost;dbname=main" live.user = "root" live.pass = i'm using parse_ini_file().
- with
ini_scanner_rawlive.dsnparsed incorrectly ("mysql:host) - with
ini_scanner_normalvalue oflive.dsncorrect
but can't use ini_scanner_normal because replace constants, "on" 1 , on (don't want that)... there fix or have create own parser?
i'm using php 5.3.
var_dump(parse_ini_string('[datasources] live.dsn = "mysql:host=localhost;dbname=main" live.user = "root"', false, ini_scanner_raw)); =>
array(2) { ["live.dsn"]=> string(32) "mysql:host=localhost;dbname=main" ["live.user"]=> string(4) "root" } i unable reproduce it. (it doesn't work parse_ini_file.) works in php 5.3 , php trunk...
i see bug in older php versions, see https://bugs.php.net/bug.php?id=51094 . upgrade, should work. if you're unable upgrade, have write own ini parser.
Comments
Post a Comment