cvs: pear /Log Log.php composite.php file.php mcal.php observer.php sql.php syslog.php
| From: | Alexander Merz | Date: | Wed, 08 Aug 2001 02:53:06 +0000 |
| Subject: | cvs: pear /Log Log.php composite.php file.php mcal.php observer.php sql.php syslog.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-437@lists.php.net to get a copy of this message | ||
alexmerz Tue Aug 7 22:53:06 2001 EDT
Modified files:
/pear/Log Log.php composite.php file.php mcal.php observer.php
sql.php syslog.php
Log:
fix PHPDoc
Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.1 pear/Log/Log.php:1.2 --- pear/Log/Log.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/Log.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: Log.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: Log.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ /** @@ -8,44 +8,54 @@ * * @author Chuck Hagenbuch <chuck@horde.org> * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log { - /** Boolean indicating whether or not the log connection is - currently open. */ + /** + * indicating whether or not the log connection is currently open. + * @var boolean + */ var $opened = false; - /** String holding the identifier that will be stored along with - each logged message. */ + /** + * holding the identifier + * that will be stored along with each logged message. + * @var string + */ var $ident = ''; - /** Array holding all Log_observer objects that wish to be notified - of any messages that we handle. */ + /** + * holding all Log_observer objects + * that wish to be notified of any messages that we handle. + * @var array + */ var $listeners = array(); /** * Attempts to return a concrete Log instance of $log_type. * - * @param $log_type The type of concrete Log subclass to return. + * @param string $log_type The type of concrete Log subclass to return. * Attempt to dynamically include the code for this * subclass. Currently, valid values are 'syslog', * 'sql', 'file', and 'mcal'. * - * @param $log_name (optional) The name of the actually log file, + * @param string $log_name The name of the actually log file, * table, or other specific store to use. Defaults * to an empty string, with which the subclass will * attempt to do something intelligent. * - * @param $ident (optional) The indentity reported to the log system. + * @param string $ident The indentity reported to the log system. * - * @param $conf (optional) A hash containing any additional + * @param array $conf A hash containing any additional * configuration information that a subclass might need. * - * @return The newly created concrete Log instance, or an + * @return object Log The newly created concrete Log instance, or an * false on an error. + * @access public */ function factory($log_type, $log_name = '', $ident = '', $conf = array()) { @@ -73,22 +83,23 @@ * syntax. Without the ampersand (&) in front of the method name, * you will not get a reference, you will get a copy.</b> * - * @param $log_type The type of concrete Log subclass to return. + * @param string $log_type The type of concrete Log subclass to return. * Attempt to dynamically include the code for * this subclass. Currently, valid values are * 'syslog', 'sql', 'file', and 'mcal'. * - * @param $log_name (optional) The name of the actually log file, + * @param string $log_name The name of the actually log file, * table, or other specific store to use. Defaults * to an empty string, with which the subclass will * attempt to do something intelligent. * - * @param $ident (optional) The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param $conf (optional) A hash containing any additional + * @param array $conf A hash containing any additional * configuration information that a subclass might need. * - * @return The concrete Log reference, or false on an error. + * @return object Log The concrete Log reference, or false on an error. + * @access public */ function &singleton($log_type, $log_name = '', $ident = '', $conf = array()) { @@ -105,7 +116,7 @@ /** * Returns the string representation of a LOG_* integer constant. * - * @param $priority The LOG_* integer constant. + * @param int $priority The LOG_* integer constant. * * @return The string representation of $priority. */ @@ -128,8 +139,9 @@ * Adds a Log_observer instance to the list of observers that are * be notified when a message is logged. * - * @param $logObserver The Log_observer instance to be added to + * @param object Log_observer &$logObserver The Log_observer instance to be added to * the $listeners array. + * @access public */ function attach(&$logObserver) { @@ -144,8 +156,9 @@ /** * Removes a Log_observer instance from the list of observers. * - * @param $logObserver The Log_observer instance to be removed + * @param object Log_observer $logObserver The Log_observer instance to be removed * from the $listeners array. + * @access public */ function detach($logObserver) { @@ -157,7 +170,7 @@ * Sends any Log_observer objects listening to this Log the message * that was just logged. * - * @param $messageOb The data structure holding all relevant log + * @param array $messageOb The data structure holding all relevant log * information - the message, the priority, what * log this is, etc. */ @@ -171,7 +184,7 @@ } /** - * @return a Boolean: true if this is a composite class, false + * @return boolean true if this is a composite class, false * otherwise. The composite subclass overrides this to return * true. */ Index: pear/Log/composite.php diff -u pear/Log/composite.php:1.1 pear/Log/composite.php:1.2 --- pear/Log/composite.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/composite.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: composite.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: composite.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/composite.php,v 1.2 2000/06/28 21:36:13 jon Exp $ /** @@ -7,23 +7,28 @@ * allows multiple Log implementations to get sent the same events. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_composite { - /** Array holding all Log instances which should be sent events - sent to the composite. */ + /** + * Array holding all Log instances + * which should be sent events sent to the composite. + * @var array + */ var $children = array(); /** * Constructs a new composite Log object. * - * @param $log_name (optional) This is ignored. - * @param $ident (optional) This is ignored. - * @param $conf (optional) This is ignored. + * @param boolean $log_name This is ignored. + * @param boolean $ident This is ignored. + * @param boolean $conf This is ignored. + * @access public */ function Log_composite($log_name = false, $ident = false, $conf = false) { @@ -32,6 +37,7 @@ /** * Open the log connections of each and every child of this * composite. + * @access public */ function open() { @@ -46,6 +52,7 @@ /** * If we've gone ahead and opened each child, go through and close * each child. + * @access public */ function close() { @@ -60,8 +67,8 @@ /** * Sends $message and $priority to every child of this composite. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority (optional) The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. @@ -77,9 +84,10 @@ } /** - * @return a Boolean: true if this is a composite class, false + * @return boolean true if this is a composite class, false * otherwise. Always returns true since this is the composite * subclass. + * @access public */ function isComposite() { @@ -90,7 +98,9 @@ * Add a Log instance to the list of children that messages sent * to us should be passed on to. * - * @param $child The Log instance to add. + * @param object Log &$child The Log instance to add. + * @access public + * @return boolean false, if &$child isn't a Log instance */ function addChild(&$child) { @@ -107,7 +117,8 @@ * Remove a Log instance from the list of children that messages * sent to us should be passed on to. * - * @param $child The Log instance to remove. + * @param object Log $child The Log instance to remove. + * @access public */ function removeChild($child) { Index: pear/Log/file.php diff -u pear/Log/file.php:1.2 pear/Log/file.php:1.3 --- pear/Log/file.php:1.2 Wed May 16 13:30:31 2001 +++ pear/Log/file.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: file.php,v 1.2 2001/05/16 17:30:31 jon Exp $ +// $Id: file.php,v 1.3 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/file.php,v 1.4 2000/06/28 21:36:13 jon Exp $ /** @@ -7,27 +7,39 @@ * abstract class which writes message to a text file. * * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @since Horde 1.3 + * @package Log */ class Log_file extends Log { - /** String holding the filename of the logfile. */ + /** + * String holding the filename of the logfile. + * @var string + */ var $filename = ''; - /** Integer holding the file handle. */ - var $fp = ''; + /** + * Integer holding the file handle. + * @var integer + */ + var $fp = 0 ; /** * Constructs a new logfile object. * - * @param $log_name The filename of the logfile. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The filename of the logfile. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_file($log_name, $ident = '', $conf = false) + function Log_file($log_name, $ident = '', $conf = array()) { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->filename = $log_name; $this->ident = $ident; } @@ -36,6 +48,7 @@ * Opens the logfile for appending, if it has not already been opened. * If the file doesn't already exist, attempt to create it. This is * implicitly called by log(), if necessary. + * @access public */ function open() { @@ -47,6 +60,7 @@ /** * Closes the logfile, if it is open. + * @access public */ function close() { @@ -61,11 +75,12 @@ * necessary. Also, passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and * LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/mcal.php diff -u pear/Log/mcal.php:1.1 pear/Log/mcal.php:1.2 --- pear/Log/mcal.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/mcal.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: mcal.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: mcal.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/mcal.php,v 1.2 2000/06/28 21:36:13 jon Exp $ /** @@ -8,39 +8,63 @@ * store accessed through MCAL. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_mcal extends Log { - /** String holding the calendar specification to connect to. */ + /** + * holding the calendar specification to connect to. + * @var string + */ var $calendar = '{localhost/mstore}'; - /** String holding the username to use. */ + /** + * holding the username to use. + * @var string + */ var $username = ''; - /** String holding the password to use. */ + /** + * holding the password to use. + * @var string + */ var $password = ''; - /** Integer holding the options to pass to the calendar stream. */ + /** + * holding the options to pass to the calendar stream. + * @var integer + */ var $options = 0; - /** ResourceID of the MCAL stream. */ + /** + * ResourceID of the MCAL stream. + * @var string + */ var $stream = ''; - /** Integer holding the log facility to use. */ + /** + * Integer holding the log facility to use. + * @var string + */ var $name = LOG_SYSLOG; /** * Constructs a new Log_mcal object. * - * @param $log_name (optional) The category to use for our events. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The category to use for our events. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_mcal($log_name = LOG_SYSLOG, $ident = '', $conf = false) + function Log_mcal($log_name = LOG_SYSLOG, $ident = '', $conf = array()) { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->name = $log_name; $this->ident = $ident; $this->calendar = $conf['calendar']; @@ -52,6 +76,7 @@ /** * Opens a calendar stream, if it has not already been * opened. This is implicitly called by log(), if necessary. + * @access public */ function open() { @@ -63,6 +88,7 @@ /** * Closes the calendar stream, if it is open. + * @access public */ function close() { @@ -78,11 +104,12 @@ * message along to any Log_observer instances that are observing * this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/observer.php diff -u pear/Log/observer.php:1.1 pear/Log/observer.php:1.2 --- pear/Log/observer.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/observer.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: observer.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: observer.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/observer.php,v 1.5 2000/06/28 21:36:13 jon Exp $ /** @@ -8,22 +8,28 @@ * actions on exceptional events. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_observer { - /** The minimum priority level of message that we want to hear - about. 0 (LOG_EMERG) is the highest priority, so we will only - hear messages with an integer priority value less than or - equal to ours. It defaults to LOG_INFO, which listens to - everything except LOG_DEBUG. */ + /** + * The minimum priority level of message that we want to hear + * about. 0 (LOG_EMERG) is the highest priority, so we will only + * hear messages with an integer priority value less than or + * equal to ours. It defaults to LOG_INFO, which listens to + * everything except LOG_DEBUG. + * @var string + */ var $priority = LOG_INFO; /** * Basic Log_observer instance that just prints out messages * received. + * @param string $priority priority level of message + * @access public */ function Log_observer($priority = LOG_INFO) { @@ -34,10 +40,11 @@ * Attempts to return a concrete Log_observer instance of the * specified type. * - * @param $observer_type The type of concrate Log_observer subclass + * @param string $observer_type The type of concrate Log_observer subclass * to return. We will attempt to dynamically * include the code for this subclass. - * @return The newly created concrete Log_observer + * @param string $priority priority level of message + * @return object Log_observer The newly created concrete Log_observer * instance, or an false on an error. */ function factory($observer_type, $priority = LOG_INFO) @@ -59,7 +66,7 @@ * desireable in practically any situation - which is why you need * to override this method. :) * - * @param $messageOb A hash containing all information - the text + * @param array $messageOb A hash containing all information - the text * message itself, the priority, what log it came * from, etc. */ Index: pear/Log/sql.php diff -u pear/Log/sql.php:1.1 pear/Log/sql.php:1.2 --- pear/Log/sql.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/sql.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: sql.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: sql.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/sql.php,v 1.12 2000/08/16 20:27:34 chuck Exp $ require_once 'DB.php'; @@ -20,30 +20,44 @@ * ); * * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_sql extends Log { - /** Array containing the dsn information. */ + /** + * Array containing the dsn information. + * @var string + */ var $dsn = ''; - /** Object holding the database handle. */ + /** + * Object holding the database handle. + * @var string + */ var $db = ''; - /** String holding the database table to use. */ + /** + * String holding the database table to use. + * @var string + */ var $table = 'log_table'; - /** Boolean indicating the current connection state. */ + /** + * Boolean indicating the current connection state. + * @var boolean + */ var $opened = false; /** * Constructs a new sql logging object. * - * @param $log_name The target SQL table. - * @param $ident (optional) The identification field. - * @param $conf The connection configuration array. + * @param string $log_name The target SQL table. + * @param string $ident The identification field. + * @param array $conf The connection configuration array. + * @access public */ function Log_sql($log_name, $ident = '', $conf) { @@ -56,7 +70,8 @@ * Opens a connection to the database, if it has not already * been opened. This is implicitly called by log(), if necessary. * - * @return True on success, false on failure. + * @return boolean True on success, false on failure. + * @access public */ function open() { @@ -73,7 +88,8 @@ /** * Closes the connection to the database, if it is open. * - * @return True on success, false on failure. + * @return boolean True on success, false on failure. + * @access public */ function close() { @@ -89,11 +105,12 @@ * if necessary. Also passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, * LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/syslog.php diff -u pear/Log/syslog.php:1.1 pear/Log/syslog.php:1.2 --- pear/Log/syslog.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/syslog.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: syslog.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: syslog.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/syslog.php,v 1.6 2000/06/28 21:36:13 jon Exp $ /** @@ -8,24 +8,33 @@ * (PHP emulates this with the Event Log on Windows machines). * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_syslog extends Log { - /** Integer holding the log facility to use. */ + /** + * Integer holding the log facility to use. + * @var string + */ var $name = LOG_SYSLOG; /** * Constructs a new syslog object. * - * @param $log_name (optional) The syslog facility. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The syslog facility. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_syslog($log_name = LOG_SYSLOG, $ident = '', $conf = false) - { + function Log_syslog($log_name = LOG_SYSLOG, $ident = '', $conf = array()) + { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->name = $log_name; $this->ident = $ident; } @@ -33,6 +42,7 @@ /** * Opens a connection to the system logger, if it has not already * been opened. This is implicitly called by log(), if necessary. + * @access public */ function open() { @@ -44,6 +54,7 @@ /** * Closes the connection to the system logger, if it is open. + * @access public */ function close() { @@ -58,11 +69,12 @@ * open() if necessary. Also passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority (optional) The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) {
Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.1 pear/Log/Log.php:1.2 --- pear/Log/Log.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/Log.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: Log.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: Log.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ /** @@ -8,44 +8,54 @@ * * @author Chuck Hagenbuch <chuck@horde.org> * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log { - /** Boolean indicating whether or not the log connection is - currently open. */ + /** + * indicating whether or not the log connection is currently open. + * @var boolean + */ var $opened = false; - /** String holding the identifier that will be stored along with - each logged message. */ + /** + * holding the identifier + * that will be stored along with each logged message. + * @var string + */ var $ident = ''; - /** Array holding all Log_observer objects that wish to be notified - of any messages that we handle. */ + /** + * holding all Log_observer objects + * that wish to be notified of any messages that we handle. + * @var array + */ var $listeners = array(); /** * Attempts to return a concrete Log instance of $log_type. * - * @param $log_type The type of concrete Log subclass to return. + * @param string $log_type The type of concrete Log subclass to return. * Attempt to dynamically include the code for this * subclass. Currently, valid values are 'syslog', * 'sql', 'file', and 'mcal'. * - * @param $log_name (optional) The name of the actually log file, + * @param string $log_name The name of the actually log file, * table, or other specific store to use. Defaults * to an empty string, with which the subclass will * attempt to do something intelligent. * - * @param $ident (optional) The indentity reported to the log system. + * @param string $ident The indentity reported to the log system. * - * @param $conf (optional) A hash containing any additional + * @param array $conf A hash containing any additional * configuration information that a subclass might need. * - * @return The newly created concrete Log instance, or an + * @return object Log The newly created concrete Log instance, or an * false on an error. + * @access public */ function factory($log_type, $log_name = '', $ident = '', $conf = array()) { @@ -73,22 +83,23 @@ * syntax. Without the ampersand (&) in front of the method name, * you will not get a reference, you will get a copy.</b> * - * @param $log_type The type of concrete Log subclass to return. + * @param string $log_type The type of concrete Log subclass to return. * Attempt to dynamically include the code for * this subclass. Currently, valid values are * 'syslog', 'sql', 'file', and 'mcal'. * - * @param $log_name (optional) The name of the actually log file, + * @param string $log_name The name of the actually log file, * table, or other specific store to use. Defaults * to an empty string, with which the subclass will * attempt to do something intelligent. * - * @param $ident (optional) The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param $conf (optional) A hash containing any additional + * @param array $conf A hash containing any additional * configuration information that a subclass might need. * - * @return The concrete Log reference, or false on an error. + * @return object Log The concrete Log reference, or false on an error. + * @access public */ function &singleton($log_type, $log_name = '', $ident = '', $conf = array()) { @@ -105,7 +116,7 @@ /** * Returns the string representation of a LOG_* integer constant. * - * @param $priority The LOG_* integer constant. + * @param int $priority The LOG_* integer constant. * * @return The string representation of $priority. */ @@ -128,8 +139,9 @@ * Adds a Log_observer instance to the list of observers that are * be notified when a message is logged. * - * @param $logObserver The Log_observer instance to be added to + * @param object Log_observer &$logObserver The Log_observer instance to be added to * the $listeners array. + * @access public */ function attach(&$logObserver) { @@ -144,8 +156,9 @@ /** * Removes a Log_observer instance from the list of observers. * - * @param $logObserver The Log_observer instance to be removed + * @param object Log_observer $logObserver The Log_observer instance to be removed * from the $listeners array. + * @access public */ function detach($logObserver) { @@ -157,7 +170,7 @@ * Sends any Log_observer objects listening to this Log the message * that was just logged. * - * @param $messageOb The data structure holding all relevant log + * @param array $messageOb The data structure holding all relevant log * information - the message, the priority, what * log this is, etc. */ @@ -171,7 +184,7 @@ } /** - * @return a Boolean: true if this is a composite class, false + * @return boolean true if this is a composite class, false * otherwise. The composite subclass overrides this to return * true. */ Index: pear/Log/composite.php diff -u pear/Log/composite.php:1.1 pear/Log/composite.php:1.2 --- pear/Log/composite.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/composite.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: composite.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: composite.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/composite.php,v 1.2 2000/06/28 21:36:13 jon Exp $ /** @@ -7,23 +7,28 @@ * allows multiple Log implementations to get sent the same events. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_composite { - /** Array holding all Log instances which should be sent events - sent to the composite. */ + /** + * Array holding all Log instances + * which should be sent events sent to the composite. + * @var array + */ var $children = array(); /** * Constructs a new composite Log object. * - * @param $log_name (optional) This is ignored. - * @param $ident (optional) This is ignored. - * @param $conf (optional) This is ignored. + * @param boolean $log_name This is ignored. + * @param boolean $ident This is ignored. + * @param boolean $conf This is ignored. + * @access public */ function Log_composite($log_name = false, $ident = false, $conf = false) { @@ -32,6 +37,7 @@ /** * Open the log connections of each and every child of this * composite. + * @access public */ function open() { @@ -46,6 +52,7 @@ /** * If we've gone ahead and opened each child, go through and close * each child. + * @access public */ function close() { @@ -60,8 +67,8 @@ /** * Sends $message and $priority to every child of this composite. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority (optional) The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. @@ -77,9 +84,10 @@ } /** - * @return a Boolean: true if this is a composite class, false + * @return boolean true if this is a composite class, false * otherwise. Always returns true since this is the composite * subclass. + * @access public */ function isComposite() { @@ -90,7 +98,9 @@ * Add a Log instance to the list of children that messages sent * to us should be passed on to. * - * @param $child The Log instance to add. + * @param object Log &$child The Log instance to add. + * @access public + * @return boolean false, if &$child isn't a Log instance */ function addChild(&$child) { @@ -107,7 +117,8 @@ * Remove a Log instance from the list of children that messages * sent to us should be passed on to. * - * @param $child The Log instance to remove. + * @param object Log $child The Log instance to remove. + * @access public */ function removeChild($child) { Index: pear/Log/file.php diff -u pear/Log/file.php:1.2 pear/Log/file.php:1.3 --- pear/Log/file.php:1.2 Wed May 16 13:30:31 2001 +++ pear/Log/file.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: file.php,v 1.2 2001/05/16 17:30:31 jon Exp $ +// $Id: file.php,v 1.3 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/file.php,v 1.4 2000/06/28 21:36:13 jon Exp $ /** @@ -7,27 +7,39 @@ * abstract class which writes message to a text file. * * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * @since Horde 1.3 + * @package Log */ class Log_file extends Log { - /** String holding the filename of the logfile. */ + /** + * String holding the filename of the logfile. + * @var string + */ var $filename = ''; - /** Integer holding the file handle. */ - var $fp = ''; + /** + * Integer holding the file handle. + * @var integer + */ + var $fp = 0 ; /** * Constructs a new logfile object. * - * @param $log_name The filename of the logfile. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The filename of the logfile. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_file($log_name, $ident = '', $conf = false) + function Log_file($log_name, $ident = '', $conf = array()) { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->filename = $log_name; $this->ident = $ident; } @@ -36,6 +48,7 @@ * Opens the logfile for appending, if it has not already been opened. * If the file doesn't already exist, attempt to create it. This is * implicitly called by log(), if necessary. + * @access public */ function open() { @@ -47,6 +60,7 @@ /** * Closes the logfile, if it is open. + * @access public */ function close() { @@ -61,11 +75,12 @@ * necessary. Also, passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and * LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/mcal.php diff -u pear/Log/mcal.php:1.1 pear/Log/mcal.php:1.2 --- pear/Log/mcal.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/mcal.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: mcal.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: mcal.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/mcal.php,v 1.2 2000/06/28 21:36:13 jon Exp $ /** @@ -8,39 +8,63 @@ * store accessed through MCAL. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_mcal extends Log { - /** String holding the calendar specification to connect to. */ + /** + * holding the calendar specification to connect to. + * @var string + */ var $calendar = '{localhost/mstore}'; - /** String holding the username to use. */ + /** + * holding the username to use. + * @var string + */ var $username = ''; - /** String holding the password to use. */ + /** + * holding the password to use. + * @var string + */ var $password = ''; - /** Integer holding the options to pass to the calendar stream. */ + /** + * holding the options to pass to the calendar stream. + * @var integer + */ var $options = 0; - /** ResourceID of the MCAL stream. */ + /** + * ResourceID of the MCAL stream. + * @var string + */ var $stream = ''; - /** Integer holding the log facility to use. */ + /** + * Integer holding the log facility to use. + * @var string + */ var $name = LOG_SYSLOG; /** * Constructs a new Log_mcal object. * - * @param $log_name (optional) The category to use for our events. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The category to use for our events. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_mcal($log_name = LOG_SYSLOG, $ident = '', $conf = false) + function Log_mcal($log_name = LOG_SYSLOG, $ident = '', $conf = array()) { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->name = $log_name; $this->ident = $ident; $this->calendar = $conf['calendar']; @@ -52,6 +76,7 @@ /** * Opens a calendar stream, if it has not already been * opened. This is implicitly called by log(), if necessary. + * @access public */ function open() { @@ -63,6 +88,7 @@ /** * Closes the calendar stream, if it is open. + * @access public */ function close() { @@ -78,11 +104,12 @@ * message along to any Log_observer instances that are observing * this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/observer.php diff -u pear/Log/observer.php:1.1 pear/Log/observer.php:1.2 --- pear/Log/observer.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/observer.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: observer.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: observer.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/observer.php,v 1.5 2000/06/28 21:36:13 jon Exp $ /** @@ -8,22 +8,28 @@ * actions on exceptional events. * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_observer { - /** The minimum priority level of message that we want to hear - about. 0 (LOG_EMERG) is the highest priority, so we will only - hear messages with an integer priority value less than or - equal to ours. It defaults to LOG_INFO, which listens to - everything except LOG_DEBUG. */ + /** + * The minimum priority level of message that we want to hear + * about. 0 (LOG_EMERG) is the highest priority, so we will only + * hear messages with an integer priority value less than or + * equal to ours. It defaults to LOG_INFO, which listens to + * everything except LOG_DEBUG. + * @var string + */ var $priority = LOG_INFO; /** * Basic Log_observer instance that just prints out messages * received. + * @param string $priority priority level of message + * @access public */ function Log_observer($priority = LOG_INFO) { @@ -34,10 +40,11 @@ * Attempts to return a concrete Log_observer instance of the * specified type. * - * @param $observer_type The type of concrate Log_observer subclass + * @param string $observer_type The type of concrate Log_observer subclass * to return. We will attempt to dynamically * include the code for this subclass. - * @return The newly created concrete Log_observer + * @param string $priority priority level of message + * @return object Log_observer The newly created concrete Log_observer * instance, or an false on an error. */ function factory($observer_type, $priority = LOG_INFO) @@ -59,7 +66,7 @@ * desireable in practically any situation - which is why you need * to override this method. :) * - * @param $messageOb A hash containing all information - the text + * @param array $messageOb A hash containing all information - the text * message itself, the priority, what log it came * from, etc. */ Index: pear/Log/sql.php diff -u pear/Log/sql.php:1.1 pear/Log/sql.php:1.2 --- pear/Log/sql.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/sql.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: sql.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: sql.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/sql.php,v 1.12 2000/08/16 20:27:34 chuck Exp $ require_once 'DB.php'; @@ -20,30 +20,44 @@ * ); * * @author Jon Parise <jon@csh.rit.edu> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_sql extends Log { - /** Array containing the dsn information. */ + /** + * Array containing the dsn information. + * @var string + */ var $dsn = ''; - /** Object holding the database handle. */ + /** + * Object holding the database handle. + * @var string + */ var $db = ''; - /** String holding the database table to use. */ + /** + * String holding the database table to use. + * @var string + */ var $table = 'log_table'; - /** Boolean indicating the current connection state. */ + /** + * Boolean indicating the current connection state. + * @var boolean + */ var $opened = false; /** * Constructs a new sql logging object. * - * @param $log_name The target SQL table. - * @param $ident (optional) The identification field. - * @param $conf The connection configuration array. + * @param string $log_name The target SQL table. + * @param string $ident The identification field. + * @param array $conf The connection configuration array. + * @access public */ function Log_sql($log_name, $ident = '', $conf) { @@ -56,7 +70,8 @@ * Opens a connection to the database, if it has not already * been opened. This is implicitly called by log(), if necessary. * - * @return True on success, false on failure. + * @return boolean True on success, false on failure. + * @access public */ function open() { @@ -73,7 +88,8 @@ /** * Closes the connection to the database, if it is open. * - * @return True on success, false on failure. + * @return boolean True on success, false on failure. + * @access public */ function close() { @@ -89,11 +105,12 @@ * if necessary. Also passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, * LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) { Index: pear/Log/syslog.php diff -u pear/Log/syslog.php:1.1 pear/Log/syslog.php:1.2 --- pear/Log/syslog.php:1.1 Tue May 15 21:17:34 2001 +++ pear/Log/syslog.php Tue Aug 7 22:53:05 2001 @@ -1,5 +1,5 @@ <?php -// $Id: syslog.php,v 1.1 2001/05/16 01:17:34 jon Exp $ +// $Id: syslog.php,v 1.2 2001/08/08 02:53:05 alexmerz Exp $ // $Horde: horde/lib/Log/syslog.php,v 1.6 2000/06/28 21:36:13 jon Exp $ /** @@ -8,24 +8,33 @@ * (PHP emulates this with the Event Log on Windows machines). * * @author Chuck Hagenbuch <chuck@horde.org> - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * @since Horde 1.3 + * @package Log */ class Log_syslog extends Log { - /** Integer holding the log facility to use. */ + /** + * Integer holding the log facility to use. + * @var string + */ var $name = LOG_SYSLOG; /** * Constructs a new syslog object. * - * @param $log_name (optional) The syslog facility. - * @param $ident (optional) The identity string. - * @param $conf (optional) The configuration array. + * @param string $log_name The syslog facility. + * @param string $ident The identity string. + * @param array $conf The configuration array. + * @access public */ - function Log_syslog($log_name = LOG_SYSLOG, $ident = '', $conf = false) - { + function Log_syslog($log_name = LOG_SYSLOG, $ident = '', $conf = array()) + { + // bc compatibilty + if( 0 == count( $conf )) { + $conf = false ; + } $this->name = $log_name; $this->ident = $ident; } @@ -33,6 +42,7 @@ /** * Opens a connection to the system logger, if it has not already * been opened. This is implicitly called by log(), if necessary. + * @access public */ function open() { @@ -44,6 +54,7 @@ /** * Closes the connection to the system logger, if it is open. + * @access public */ function close() { @@ -58,11 +69,12 @@ * open() if necessary. Also passes the message along to any Log_observer * instances that are observing this Log. * - * @param $message The textual message to be logged. - * @param $priority (optional) The priority of the message. Valid + * @param string $message The textual message to be logged. + * @param string $priority (optional) The priority of the message. Valid * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT, * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, * and LOG_DEBUG. The default is LOG_INFO. + * @access public */ function log($message, $priority = LOG_INFO) {