php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #33574 parse_ini_file fails to parse values containing "{"
Submitted: 2005-07-05 13:38 UTC Modified: 2005-07-07 15:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: m at tacker dot org Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.0b2 OS: Gentoo Linux
Private report: No CVE-ID: None
 [2005-07-05 13:38 UTC] m at tacker dot org
Description:
------------
PHP 5.1's parse_ini_file cannot parse this line where 5.0's can:

from_email = NOREPLY.{installation.id}@{mailer.hostname}

Expected result:
----------------
An array with
$config = array(
'from_email' => 'NOREPLY.{installation.id}@{mailer.hostname}'
);

Actual result:
--------------
Warning: Error parsing ../include/config/config.ini

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-05 13:42 UTC] m at tacker dot org
Using quotations fixes that problem.
 [2005-07-05 15:29 UTC] sniper@php.net
This is not a bug but new feature added in PHP 5.1 by Andrei:

"
Adding ability to refer to existing .ini variables from within .ini
files. Example:

open_basedir = ${open_basedir} ":/new/dir"
"

Quoting the values is very good idea anyway..
This isn't documented anywhere -> reclassified.

 [2005-07-05 15:58 UTC] m at tacker dot org
Wow, cool. That is a feature I implemented myself.
How do I address values under sections with that?

[example]
name = value

[values_from_example]
name = ${example.name}
 [2005-07-07 15:43 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

configuration: "Since PHP 5.1.0, it is possible to refer to existing .ini variables from within .ini files. Example: open_basedir = ${open_basedir} ":/new/dir"."

Necessity of quoting values is already declared by parse_ini_file: "If a value in the ini file contains any non-alphanumeric characters it needs to be enclosed in double-quotes (")."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 25 10:01:32 2024 UTC