Author: kurdalen
Date: Tue Apr 28 12:12:31 2009
New Revision: 769355
URL: http://svn.apache.org/viewvc?rev=769355&view=rev
Log:
fixed #LOG4PHP-28
Modified:
incubator/log4php/trunk/src/examples/php/console.properties
incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
Modified: incubator/log4php/trunk/src/examples/php/console.properties
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/examples/php/console.properties?rev=769355&r1=769354&r2=769355&view=diff
==============================================================================
--- incubator/log4php/trunk/src/examples/php/console.properties (original)
+++ incubator/log4php/trunk/src/examples/php/console.properties Tue Apr 28
12:12:31 2009
@@ -16,6 +16,6 @@
; limitations under the License.
;
log4php.appender.console = LoggerAppenderConsole
-log4php.appender.console.target = STDOUT
+log4php.appender.console.target = "STDOUT"
log4php.appender.console.layout = LoggerLayoutSimple
log4php.rootLogger = DEBUG, console
Modified: incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php?rev=769355&r1=769354&r2=769355&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php
(original)
+++ incubator/log4php/trunk/src/main/php/LoggerPropertyConfigurator.php Tue Apr
28 12:12:31 2009
@@ -331,9 +331,10 @@
function doConfigure($url, &$repository)
{
$properties = @parse_ini_file($url);
- if (count($properties) == 0) {
+ if($properties === false || count($properties) == 0) {
+ // as of PHP 5.2.7 parse_ini_file() returns FALSE
instead of an empty array
LoggerLog::warn("LoggerPropertyConfigurator::doConfigure() cannot
load '$url' configuration.");
- return false;
+ return false;
}
return $this->doConfigureProperties($properties, $repository);
}
Modified:
incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
URL:
http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php?rev=769355&r1=769354&r2=769355&view=diff
==============================================================================
--- incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
(original)
+++ incubator/log4php/trunk/src/main/php/appenders/LoggerAppenderConsole.php
Tue Apr 28 12:12:31 2009
@@ -53,7 +53,7 @@
* Default is STDOUT
* @var string
*/
- protected $target = 'php://stdout';
+ protected $target = self::STDOUT;
/**
* @var boolean
@@ -76,7 +76,7 @@
if ($v == self::STDOUT || strtoupper($v) == 'STDOUT') {
$this->target = self::STDOUT;
} elseif ($v == self::STDERR || strtoupper($v) == 'STDERR') {
- $target = self::STDERR;
+ $this->target = self::STDERR;
} else {
LoggerLog::debug("Invalid target. Using '".self::STDOUT."' by
default.");
}