Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- debug => false in conf doesn't work when adding a new application (…

…Bug #7564; thx to Matthias)

git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@217691 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 3884f2f3d75c788fa510caf88e34cdad64a24574 1 parent b17f781
Lukas Smith authored
Showing with 34 additions and 32 deletions.
  1. +34 −32 LiveUser.php
View
66 LiveUser.php
@@ -772,40 +772,42 @@ function readConfig(&$conf)
*/
function &PEARLogFactory(&$log)
{
- if (!is_object($log)) {
- require_once 'Log.php';
- $log =& Log::factory('composite');
- if (!is_a($log, 'Log_composite')) {
- $this->stack->push(
- LIVEUSER_ERROR_CONFIG, 'exception', array(),
- 'Could not create Log instance'
- );
- $return = false;
- return $return;
- }
- $conf = array('colors' =>
- array(
- PEAR_LOG_EMERG => 'red',
- PEAR_LOG_ALERT => 'orange',
- PEAR_LOG_CRIT => 'yellowgreen',
- PEAR_LOG_ERR => 'green',
- PEAR_LOG_WARNING => 'blue',
- PEAR_LOG_NOTICE => 'indigo',
- PEAR_LOG_INFO => 'violet',
- PEAR_LOG_DEBUG => 'black',
- ),
+ if (empty($log) || is_object($log)) {
+ return $log;
+ }
+
+ require_once 'Log.php';
+ $log =& Log::factory('composite');
+ if (!is_a($log, 'Log_composite')) {
+ $this->stack->push(
+ LIVEUSER_ERROR_CONFIG, 'exception', array(),
+ 'Could not create Log instance'
);
- $winlog =& Log::factory('win', 'LiveUser', 'LiveUser', $conf);
- if (!is_a($winlog, 'Log_win')) {
- $this->stack->push(
- LIVEUSER_ERROR_CONFIG, 'exception', array(),
- 'Could not create Log "window" instance'
- );
- $return = false;
- return $return;
- }
- $log->addChild($winlog);
+ $return = false;
+ return $return;
+ }
+ $conf = array(
+ 'colors' => array(
+ PEAR_LOG_EMERG => 'red',
+ PEAR_LOG_ALERT => 'orange',
+ PEAR_LOG_CRIT => 'yellowgreen',
+ PEAR_LOG_ERR => 'green',
+ PEAR_LOG_WARNING => 'blue',
+ PEAR_LOG_NOTICE => 'indigo',
+ PEAR_LOG_INFO => 'violet',
+ PEAR_LOG_DEBUG => 'black',
+ ),
+ );
+ $winlog =& Log::factory('win', 'LiveUser', 'LiveUser', $conf);
+ if (!is_a($winlog, 'Log_win')) {
+ $this->stack->push(
+ LIVEUSER_ERROR_CONFIG, 'exception', array(),
+ 'Could not create Log "window" instance'
+ );
+ $return = false;
+ return $return;
}
+ $log->addChild($winlog);
return $log;
}
Please sign in to comment.
Something went wrong with that request. Please try again.