home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / HTML / Progress / observer.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  2.9 KB  |  92 lines

  1. <?php
  2. /**
  3.  * The HTML_Progress_Observer implements the observer pattern
  4.  * for watching progress bar activity and taking actions
  5.  * on exceptional events.
  6.  *
  7.  * PHP versions 4 and 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @category   HTML
  16.  * @package    HTML_Progress
  17.  * @subpackage Progress_Observer
  18.  * @author     Laurent Laville <pear@laurent-laville.org>
  19.  * @copyright  1997-2005 The PHP Group
  20.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  21.  * @version    CVS: $Id: observer.php,v 1.4 2005/07/25 13:02:33 farell Exp $
  22.  * @link       http://pear.php.net/package/HTML_Progress
  23.  */
  24.  
  25. /**
  26.  * The HTML_Progress_Observer implements the observer pattern
  27.  * for watching progress bar activity and taking actions
  28.  * on exceptional events.
  29.  *
  30.  * PHP versions 4 and 5
  31.  *
  32.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  33.  * that is available through the world-wide-web at the following URI:
  34.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  35.  * the PHP License and are unable to obtain it through the web, please
  36.  * send a note to license@php.net so we can mail you a copy immediately.
  37.  *
  38.  * @category   HTML
  39.  * @package    HTML_Progress
  40.  * @subpackage Progress_Observer
  41.  * @author     Laurent Laville <pear@laurent-laville.org>
  42.  * @copyright  1997-2005 The PHP Group
  43.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  44.  * @version    Release: 1.2.5
  45.  * @link       http://pear.php.net/package/HTML_Progress
  46.  */
  47.  
  48. class HTML_Progress_Observer
  49. {
  50.     /**
  51.      * Instance-specific unique identification number.
  52.      *
  53.      * @var        integer
  54.      * @since      1.0
  55.      * @access     private
  56.      */
  57.     var $_id;
  58.  
  59.     /**
  60.      * Creates a new basic HTML_Progress_Observer instance.
  61.      *
  62.      * @since      1.0
  63.      * @access     public
  64.      */
  65.     function HTML_Progress_Observer()
  66.     {
  67.         $this->_id = md5(microtime());
  68.     }
  69.  
  70.     /**
  71.      * This is a stub method to make sure that HTML_Progress_Observer classes do
  72.      * something when they are notified of a message.  The default behavior
  73.      * is to just write into a file 'progress_observer.log' in current directory.
  74.      * You should override this method.
  75.      *
  76.      * Default events :
  77.      * - setMinimum
  78.      * - setMaximum
  79.      * - setValue
  80.      *
  81.      * @param      mixed     $event         A hash describing the progress event.
  82.      * @since      1.0
  83.      * @access     public
  84.      */
  85.     function notify($event)
  86.     {
  87.         $msg = (is_array($event)) ? serialize($event) : $event;
  88.         error_log ("$msg \n", 3, 'progress_observer.log');
  89.     }
  90. }
  91.  
  92. ?>