Author: ihabunek
Date: Tue Jul 27 14:55:45 2010
New Revision: 979738

URL: http://svn.apache.org/viewvc?rev=979738&view=rev
Log:
LOG4PHP-117: LoggerConfiguratorIni::configure() and unexptected results from 
error_get_last()

Modified:
    logging/log4php/trunk/src/changes/changes.xml
    logging/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php

Modified: logging/log4php/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4php/trunk/src/changes/changes.xml?rev=979738&r1=979737&r2=979738&view=diff
==============================================================================
--- logging/log4php/trunk/src/changes/changes.xml (original)
+++ logging/log4php/trunk/src/changes/changes.xml Tue Jul 27 14:55:45 2010
@@ -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>

Modified: 
logging/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php
URL: 
http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php?rev=979738&r1=979737&r2=979738&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php 
(original)
+++ logging/log4php/trunk/src/main/php/configurators/LoggerConfiguratorIni.php 
Tue Jul 27 14:55:45 2010
@@ -283,12 +283,16 @@ class LoggerConfiguratorIni implements L
         */
        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>.


Reply via email to