Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: 1.0.3
-
Component/s: Zend_Config
-
Labels:None
Description
Actually, Zend_Config_Ini and Zend_Config_Xml never check if the file you try to access is readable.
Instead of that, they try to load it ( respectively by parse_ini_file(), and simplexml_load_file ), thus making a warning appear if the file can't be found or read.
These classes should try to read the file passed to their constructor, before making buz with them, and throw exceptions if there's a problem.
Actual Zend_Config_Ini code ( same for Zend_Config_Xml ) :
public function __construct($filename, $section, $config = false) { if (empty($filename)) { throw new Zend_Config_Exception('Filename is not set'); } (...)
Improvement :
public function __construct($filename, $section, $config = false) { if (empty($filename) || !is_readable($filename)) { throw new Zend_Config_Exception('Filename is not set'); } (...)
Fixed in svn 6909 (trunk) and 6910 (release-1.0 branch)