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_raw live.dsn parsed incorrectly ("mysql:host)
  • with ini_scanner_normal value of live.dsn correct

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

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -