Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.6.0RC1, 1.6.0RC2
-
Fix Version/s: 1.6.0
-
Component/s: Zend_Config
-
Labels:None
Description
Zend_Config_ini use a error handler for "convert any warnings into exceptions"
Zend_Config_Ini.php / __construct / LOC: 108
$old_error_handler = set_error_handler(array('Zend_Config_Ini', 'parseIniFileErrorHandler'));
$iniArray = parse_ini_file($filename, true); // convert any warnings into exceptions
restore_error_handler();
But apparently the function restore_error_handler doesn't works good, because the next use of Zend_Loader::isReadable throws an exception.
For example:
<?php
include_once ('Zend/Loader.php');
include_once ('Zend/Config/Ini.php');
try {
$config = new Zend_Config_Ini ('errorini', 'errorsection');
} catch (Exception $e) {
//Whoa! No error!
}
Zend_Loader::isReadable ('errorfile'); // Doesn't returns boolean, instead throws a Zend_Config_Exception
Issue Links
| This issue is related to: | ||||
| ZF-4139 | Zend_Loader::autoload() generates warnings instead of returning false without any output. |
|
|
|
Ok I got it.
restore_error_handler() should be used in the parseIniFileErrorHandler(), like this :
But this seems to bug as well, and seems to be a PHP bug ( or feature ). (PHP 5.2.6)
– restore_error_handler() looks like to be ignored while written in a error handler callback function –
To fix the bug, set_error_handler($oldHandler) works, like this :
Rob, what do you think about that ?