LOG4PHP-117: LoggerConfiguratorIni::configure() and unexptected results from error_ge...
authorIvan Habunek <ihabunek@apache.org>
Tue, 27 Jul 2010 14:55:45 +0000 (14:55 +0000)
committerIvan Habunek <ihabunek@apache.org>
Tue, 27 Jul 2010 14:55:45 +0000 (14:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/logging/log4php/trunk@979738 13f79535-47bb-0310-9956-ffa450edef68

src/changes/changes.xml
src/main/php/configurators/LoggerConfiguratorIni.php

index e7888e1..cc7be3f 100644 (file)
@@ -24,6 +24,7 @@
   </properties>
   <body>
        <release version="2.1" description="Stabilizing">
+               <action type="fix" issue="LOG4PHP-117" by="Maciej Mazur, Ivan Habunek">LoggerConfiguratorIni::configure() and unexptected results from error_get_last()</action>
                <action type="fix" issue="LOG4PHP-113" by="Ivan Habunek">Milliseconds do not change when using LoggerLayoutPattern</action>
                <action type="fix" issue="LOG4PHP-115" by="Vaceletm">Instanciate LoggerAppenderPDO by hand throw exception</action>
                <action type="update" issue="LOG4PHP-36" by="Moritz Schmidt">PHP Configurator: set remaining properties to appenders</action>
index 10cd231..e3591fd 100644 (file)
@@ -283,12 +283,16 @@ class LoggerConfiguratorIni implements LoggerConfigurator {
         */
        public function configure(LoggerHierarchy $hierarchy, $url = '') {
                $properties = @parse_ini_file($url);
-               if ($properties === false || count($properties) == 0) {
+               if ($properties === false) {
                        $error = error_get_last();
-                   throw new LoggerException("LoggerConfiguratorIni: ".$error['message']);
+                       throw new LoggerException("LoggerConfiguratorIni: Error parsing configuration file: ".$error['message']);
                }
+               if  (count($properties) == 0) {
+                       trigger_error("LoggerConfiguratorIni: Configuration file is empty.", E_USER_WARNING);
+               }
+               
                return $this->doConfigureProperties($properties, $hierarchy);
-       }
+       } 
 
        /**
         * Read configuration options from <b>properties</b>.