php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54276 ini_get can't read pdo.dsn.*
Submitted: 2011-03-16 16:55 UTC Modified: 2015-09-07 17:41 UTC
From: jinmoku at hotmail dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.5 OS: Win 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jinmoku at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-03-16 16:55 UTC] jinmoku at hotmail dot com
Description:
------------
ini_get can't read pdo.dsn.* in the php.ini

Test script:
---------------
//ini : pdo.dsn.test = sqlite::memory:
$dbh = new PDO('test');
var_dump(ini_get('pdo.dsn.test'));

Expected result:
----------------
string(15) "sqlite::memory:"

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-16 18:45 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-03-16 18:45 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The is no such ini entries. ini_get() only works for settings defined by PHP.
 [2011-03-17 08:44 UTC] carsten_sttgt at gmx dot de
@johannes
> The is no such ini entries.

The manual [1] describes this as an INI option like any other:
| pdo.dsn.* string [php.ini only]

So it should be possible to use ini_get() to get the value.
 [2011-03-17 10:23 UTC] johannes@php.net
-Status: Bogus +Status: Open
 [2011-03-17 10:23 UTC] johannes@php.net
Interesting. But well in the sense of PHP they don't exist but PDO uses a hack to use them anyways. I doubt ini_get should use such hacks.
 [2011-03-17 11:25 UTC] carsten_sttgt at gmx dot de
> I doubt ini_get should use such hacks.

With get_cfg_var() I can get such values:
| var_dump(get_cfg_var('pdo.dsn.test'));
| string(15) "sqlite::memory:"

| 5.3.0   get_cfg_var() was fixed to be able to return "array" ini options. 

(At least the manual should describe this restriction for ini_get[_all] or phpinfo.)
 [2011-04-12 20:26 UTC] iliaa@php.net
-Package: PDO related +Package: Documentation problem
 [2015-09-07 17:40 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337776
Log: ini_get(_all) can't read "array" options (fixes #54276)
 [2015-09-07 17:41 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-09-07 17:41 UTC] cmb@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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 15:01:30 2024 UTC