cvs: pear /Log Log.php
| From: | Jon Parise | Date: | Mon, 29 Apr 2002 04:43:11 +0000 |
| Subject: | cvs: pear /Log Log.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3612@lists.php.net to get a copy of this message | ||
jon Mon Apr 29 00:43:11 2002 EDT
Modified files:
/pear/Log Log.php
Log:
PHPDoc formatting / updates
Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.5 pear/Log/Log.php:1.6 --- pear/Log/Log.php:1.5 Mon Apr 29 00:34:15 2002 +++ pear/Log/Log.php Mon Apr 29 00:43:11 2002 @@ -1,5 +1,5 @@ <?php -// $Id: Log.php,v 1.5 2002/04/29 04:34:15 jon Exp $ +// $Id: Log.php,v 1.6 2002/04/29 04:43:11 jon Exp $ // $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ /** @@ -8,7 +8,7 @@ * * @author Chuck Hagenbuch <chuck@horde.org> * @author Jon Parise <jon@horde.org> - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @since Horde 1.3 * @package Log */ @@ -31,7 +31,7 @@ var $_ident = ''; /** - * Holds all Log_observer objects that wish to be notified of new messages + * Holds all Log_observer objects that wish to be notified of new messages. * * @var array * @access private @@ -43,22 +43,22 @@ * Attempts to return a concrete Log instance of $log_type. * * @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 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. + * Attempt to dynamically include the code for + * this subclass. Currently, valid values are + * 'console', 'syslog', 'sql', 'file', and 'mcal'. + * + * @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 string $ident The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param array $conf A hash containing any additional - * configuration information that a subclass might need. + * @param array $conf A hash containing any additional configuration + * information that a subclass might need. * - * @return object Log The newly created concrete Log instance, or an - * false on an error. + * @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()) @@ -74,35 +74,36 @@ } /** - * Attempts to return a reference to a concrete Log instance of - * $log_type, only creating a new instance if no log instance with - * the same parameters currently exists. - * - * You should use this if there are multiple places you might - * create a logger, you don't want to create multiple loggers, and - * you don't want to check for the existance of one each time. The - * singleton pattern does all the checking work for you. - * - * <b>You MUST call this method with the $var = &Log::singleton() - * syntax. Without the ampersand (&) in front of the method name, - * you will not get a reference, you will get a copy.</b> + * Attempts to return a reference to a concrete Log instance of $log_type, + * only creating a new instance if no log instance with the same parameters + * currently exists. + * + * You should use this if there are multiple places you might create a + * logger, you don't want to create multiple loggers, and you don't want to + * check for the existance of one each time. The singleton pattern does all + * the checking work for you. + * + * <b>You MUST call this method with the $var = &Log::singleton() syntax. + * Without the ampersand (&) in front of the method name, you will not get + * a reference, you will get a copy.</b> * * @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 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. + * Attempt to dynamically include the code for + * this subclass. Currently, valid values are + * 'console', 'syslog', 'sql', 'file', and 'mcal'. + * + * @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 string $ident The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param array $conf A hash containing any additional - * configuration information that a subclass might need. + * @param array $conf A hash containing any additional configuration + * information that a subclass might need. * - * @return object Log The concrete Log reference, or false on an error. + * @return object Log The newly created concrete Log instance, or an + * false on an error. * @access public */ function &singleton($log_type, $log_name = '', $ident = '', $conf = array()) @@ -121,9 +122,9 @@ /** * Returns the string representation of a LOG_* integer constant. * - * @param int $priority The LOG_* integer constant. + * @param int $priority A LOG_* integer constant. * - * @return The string representation of $priority. + * @return string The string representation of $priority. */ function priorityToString($priority) { @@ -142,8 +143,8 @@ } /** - * Adds a Log_observer instance to the list of observers that are - * be notified when a message is logged. + * Adds a Log_observer instance to the list of observers that are be + * notified when a message is logged. * * @param object Log_observer &$logObserver The Log_observer instance to * be added to the $listeners @@ -180,24 +181,24 @@ * Sends any Log_observer objects listening to this Log the message * that was just logged. * - * @param array $messageOb The data structure holding all relevant log - * information - the message, the priority, what - * log this is, etc. + * @param array $msgObj The data structure holding all relevant log + * information - the message, the priority, what + * log this is, etc. */ - function notifyAll($messageOb) + function notifyAll($msgObj) { reset($this->_listeners); foreach ($this->_listeners as $listener) { - if ($messageOb['priority'] <= $listener->priority) { - $listener->notify($messageOb); + if ($msgObj['priority'] <= $listener->priority) { + $listener->notify($msgObj); } } } /** - * @return boolean true if this is a composite class, false - * otherwise. The composite subclass overrides this to return - * true. + * Indicates whether this is a composite class. + * + * @return boolean True if this is a composite class. */ function isComposite() {
Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.5 pear/Log/Log.php:1.6 --- pear/Log/Log.php:1.5 Mon Apr 29 00:34:15 2002 +++ pear/Log/Log.php Mon Apr 29 00:43:11 2002 @@ -1,5 +1,5 @@ <?php -// $Id: Log.php,v 1.5 2002/04/29 04:34:15 jon Exp $ +// $Id: Log.php,v 1.6 2002/04/29 04:43:11 jon Exp $ // $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ /** @@ -8,7 +8,7 @@ * * @author Chuck Hagenbuch <chuck@horde.org> * @author Jon Parise <jon@horde.org> - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @since Horde 1.3 * @package Log */ @@ -31,7 +31,7 @@ var $_ident = ''; /** - * Holds all Log_observer objects that wish to be notified of new messages + * Holds all Log_observer objects that wish to be notified of new messages. * * @var array * @access private @@ -43,22 +43,22 @@ * Attempts to return a concrete Log instance of $log_type. * * @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 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. + * Attempt to dynamically include the code for + * this subclass. Currently, valid values are + * 'console', 'syslog', 'sql', 'file', and 'mcal'. + * + * @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 string $ident The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param array $conf A hash containing any additional - * configuration information that a subclass might need. + * @param array $conf A hash containing any additional configuration + * information that a subclass might need. * - * @return object Log The newly created concrete Log instance, or an - * false on an error. + * @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()) @@ -74,35 +74,36 @@ } /** - * Attempts to return a reference to a concrete Log instance of - * $log_type, only creating a new instance if no log instance with - * the same parameters currently exists. - * - * You should use this if there are multiple places you might - * create a logger, you don't want to create multiple loggers, and - * you don't want to check for the existance of one each time. The - * singleton pattern does all the checking work for you. - * - * <b>You MUST call this method with the $var = &Log::singleton() - * syntax. Without the ampersand (&) in front of the method name, - * you will not get a reference, you will get a copy.</b> + * Attempts to return a reference to a concrete Log instance of $log_type, + * only creating a new instance if no log instance with the same parameters + * currently exists. + * + * You should use this if there are multiple places you might create a + * logger, you don't want to create multiple loggers, and you don't want to + * check for the existance of one each time. The singleton pattern does all + * the checking work for you. + * + * <b>You MUST call this method with the $var = &Log::singleton() syntax. + * Without the ampersand (&) in front of the method name, you will not get + * a reference, you will get a copy.</b> * * @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 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. + * Attempt to dynamically include the code for + * this subclass. Currently, valid values are + * 'console', 'syslog', 'sql', 'file', and 'mcal'. + * + * @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 string $ident The identity reported to the log system. + * @param string $ident The identity reported to the log system. * - * @param array $conf A hash containing any additional - * configuration information that a subclass might need. + * @param array $conf A hash containing any additional configuration + * information that a subclass might need. * - * @return object Log The concrete Log reference, or false on an error. + * @return object Log The newly created concrete Log instance, or an + * false on an error. * @access public */ function &singleton($log_type, $log_name = '', $ident = '', $conf = array()) @@ -121,9 +122,9 @@ /** * Returns the string representation of a LOG_* integer constant. * - * @param int $priority The LOG_* integer constant. + * @param int $priority A LOG_* integer constant. * - * @return The string representation of $priority. + * @return string The string representation of $priority. */ function priorityToString($priority) { @@ -142,8 +143,8 @@ } /** - * Adds a Log_observer instance to the list of observers that are - * be notified when a message is logged. + * Adds a Log_observer instance to the list of observers that are be + * notified when a message is logged. * * @param object Log_observer &$logObserver The Log_observer instance to * be added to the $listeners @@ -180,24 +181,24 @@ * Sends any Log_observer objects listening to this Log the message * that was just logged. * - * @param array $messageOb The data structure holding all relevant log - * information - the message, the priority, what - * log this is, etc. + * @param array $msgObj The data structure holding all relevant log + * information - the message, the priority, what + * log this is, etc. */ - function notifyAll($messageOb) + function notifyAll($msgObj) { reset($this->_listeners); foreach ($this->_listeners as $listener) { - if ($messageOb['priority'] <= $listener->priority) { - $listener->notify($messageOb); + if ($msgObj['priority'] <= $listener->priority) { + $listener->notify($msgObj); } } } /** - * @return boolean true if this is a composite class, false - * otherwise. The composite subclass overrides this to return - * true. + * Indicates whether this is a composite class. + * + * @return boolean True if this is a composite class. */ function isComposite() {