Permalink
Browse files

updating PEAR Log to 1.13.1

  • Loading branch information...
Peter Adams
Peter Adams committed Dec 17, 2016
1 parent bda2160 commit 2622af52b98e9baf2cb75225747bb8143b995d71
@@ -3,7 +3,7 @@
* $Header$
* $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $
*
* @version $Revision: 310238 $
* @version $Revision$
* @package Log
*/
@@ -86,7 +86,7 @@ class Log
var $_listeners = array();
/**
* Starting depth to use when walking a backtrace in search of the
* Starting depth to use when walking a backtrace in search of the
* function that invoked the log system.
*
* @var integer
@@ -111,6 +111,10 @@ class Log
'%{class}' => '%8$s',
'%\{' => '%%{');
public function __construct()
{
}
/**
* Attempts to return a concrete Log instance of type $handler.
*
@@ -512,8 +516,8 @@ function _getBacktraceVars($depth)
}
/**
* Sets the starting depth to use when walking a backtrace in search of
* the function that invoked the log system. This is used on conjunction
* Sets the starting depth to use when walking a backtrace in search of
* the function that invoked the log system. This is used on conjunction
* with the 'file', 'line', 'function', and 'class' formatters.
*
* @param int $depth The new backtrace depth.
@@ -712,7 +716,7 @@ function setMask($mask)
/**
* Returns the current level mask.
*
* @return interger The current level mask.
* @return integer The current level mask.
*
* @access public
* @since Log 1.7.0
@@ -771,7 +775,7 @@ function setPriority($priority)
* @param object $observer The Log_observer instance to attach as a
* listener.
*
* @param boolean True if the observer is successfully attached.
* @return boolean True if the observer is successfully attached.
*
* @access public
* @since Log 1.0
@@ -793,7 +797,7 @@ function attach(&$observer)
* @param object $observer The Log_observer instance to detach from
* the list of listeners.
*
* @param boolean True if the observer is successfully detached.
* @return boolean True if the observer is successfully detached.
*
* @access public
* @since Log 1.0
@@ -3,7 +3,7 @@
* $Header$
* $Horde: horde/lib/Log/composite.php,v 1.2 2000/06/28 21:36:13 jon Exp $
*
* @version $Revision: 305990 $
* @version $Revision$
* @package Log
*/
@@ -35,15 +35,15 @@ class Log_composite extends Log
/**
* Constructs a new composite Log object.
*
* @param boolean $name This parameter is ignored.
* @param boolean $ident This parameter is ignored.
* @param boolean $conf This parameter is ignored.
* @param boolean $level This parameter is ignored.
* @param string $name This parameter is ignored.
* @param string $ident This parameter is ignored.
* @param array $conf This parameter is ignored.
* @param int $level This parameter is ignored.
*
* @access public
*/
function Log_composite($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_ident = $ident;
}
@@ -143,22 +143,22 @@ function log($message, $priority = null)
}
/*
* Abort early if the priority is above the composite handler's
* Abort early if the priority is above the composite handler's
* maximum logging level.
*
* XXX: Consider whether or not introducing this change would break
* backwards compatibility. Some users may be expecting composite
* handlers to pass on all events to their children regardless of
* backwards compatibility. Some users may be expecting composite
* handlers to pass on all events to their children regardless of
* their own priority.
*/
#if (!$this->_isMasked($priority)) {
# return false;
#}
/*
* Iterate over all of our children. If a unopened child will respond
* Iterate over all of our children. If a unopened child will respond
* to this log event, we attempt to open it immediately. The composite
* handler's opened state will be enabled as soon as the first child
* handler's opened state will be enabled as soon as the first child
* handler is successfully opened.
*
* We track an overall success state that indicates whether or not all
@@ -2,14 +2,14 @@
/**
* $Header$
*
* @version $Revision: 306594 $
* @version $Revision$
* @package Log
*/
/**
* The Log_console class is a concrete implementation of the Log::
* abstract class which writes message to the text console.
*
*
* @author Jon Parise <jon@php.net>
* @since Log 1.1
* @package Log
@@ -64,17 +64,17 @@ class Log_console extends Log
/**
* Constructs a new Log_console object.
*
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_console($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
@@ -175,7 +175,7 @@ function flush()
/**
* Writes $message to the text console. Also, passes the message
* along to any Log_observer instances that are observing this Log.
*
*
* @param mixed $message String or object containing the message to log.
* @param string $priority The priority of the message. Valid
* values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
@@ -2,7 +2,7 @@
/**
* $Header$
*
* @version $Revision: 250926 $
* @version $Revision$
* @package Log
*/
@@ -12,7 +12,7 @@
* This class uses the syslog protocol: http://www.ietf.org/rfc/rfc3164.txt
*
* @author Bart van der Schans <schans@dds.nl>
* @version $Revision: 250926 $
* @version $Revision$
* @package Log
*/
class Log_daemon extends Log
@@ -61,25 +61,24 @@ class Log_daemon extends Log
*/
var $_timeout = 1;
/**
* Constructs a new syslog object.
*
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $maxLevel Maximum level at which to log.
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Maximum level at which to log.
* @access public
*/
function Log_daemon($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
/* Ensure we have a valid integer value for $name. */
if (empty($name) || !is_int($name)) {
$name = LOG_SYSLOG;
}
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_name = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
@@ -2,7 +2,7 @@
/**
* $Header$
*
* @version $Revision: 305290 $
* @version $Revision$
* @package Log
*/
@@ -38,8 +38,8 @@ class Log_display extends Log
var $_timeFormat = '%b %d %H:%M:%S';
/**
* Flag indicating whether raw message text should be passed directly to
* the log system. Otherwise, the text will be converted to an HTML-safe
* Flag indicating whether raw message text should be passed directly to
* the log system. Otherwise, the text will be converted to an HTML-safe
* representation.
* @var boolean
* @access private
@@ -55,10 +55,10 @@ class Log_display extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_display($name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
@@ -160,7 +160,7 @@ function log($message, $priority = null)
/* Extract the string representation of the message. */
$message = $this->_extractMessage($message);
/* Convert the message to an HTML-friendly represention unless raw
/* Convert the message to an HTML-friendly represention unless raw
* text has been requested. */
if ($this->_rawText === false) {
$message = nl2br(htmlspecialchars($message));
@@ -2,7 +2,7 @@
/**
* $Header$
*
* @version $Revision: 293927 $
* @version $Revision$
* @package Log
*/
@@ -65,10 +65,10 @@ class Log_error_log extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_error_log($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_type = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
@@ -2,14 +2,14 @@
/**
* $Header$
*
* @version $Revision: 224513 $
* @version $Revision$
* @package Log
*/
/**
* The Log_file class is a concrete implementation of the Log abstract
* class that logs messages to a text file.
*
*
* @author Jon Parise <jon@php.net>
* @author Roman Neuhauser <neuhauser@bellavista.cz>
* @since Log 1.0
@@ -95,10 +95,10 @@ class Log_file extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_file($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_filename = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
@@ -302,7 +302,7 @@ function log($message, $priority = null)
/* Write the log line to the log file. */
$success = (fwrite($this->_fp, $line) !== false);
/* Unlock the file now that we're finished writing to it. */
/* Unlock the file now that we're finished writing to it. */
if ($this->_locking) {
flock($this->_fp, LOCK_UN);
}
@@ -2,7 +2,7 @@
/**
* $Header$
*
* @version $Revision: 313304 $
* @version $Revision$
* @package Log
*/
@@ -78,10 +78,10 @@ class Log_firebug extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_firebug($name = '', $ident = 'PHP', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name = '', $ident = 'PHP', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
if (isset($conf['buffering'])) {
@@ -182,11 +182,11 @@ function log($message, $priority = null)
/* normalize line breaks and escape quotes*/
$message = preg_replace("/\r?\n/", "\\n", addslashes($message));
/* Build the string containing the complete log line. */
$line = $this->_format($this->_lineFormat,
strftime($this->_timeFormat),
$priority,
$priority,
$message);
if ($this->_buffering) {
@@ -2,7 +2,7 @@
/**
* $Header$
*
* @version $Revision: 266658 $
* @version $Revision$
* @package Log
*/
@@ -116,10 +116,10 @@ class Log_mail extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_mail($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_id = md5(microtime().rand());
$this->_recipients = $name;
$this->_ident = $ident;
$this->_mask = Log::UPTO($level);
Oops, something went wrong.

0 comments on commit 2622af5

Please sign in to comment.