convenient_website /lib/php/HTML/Progress/observer.php

Language PHP Lines 92
MD5 Hash 35db68c95f4332036bbac364ec690fe0 Estimated Cost $283 (why?)
Repository https://bitbucket.org/adarshj/convenient_website.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/**
 * The HTML_Progress_Observer implements the observer pattern
 * for watching progress bar activity and taking actions
 * on exceptional events.
 *
 * PHP versions 4 and 5
 *
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to license@php.net so we can mail you a copy immediately.
 *
 * @category   HTML
 * @package    HTML_Progress
 * @subpackage Progress_Observer
 * @author     Laurent Laville <pear@laurent-laville.org>
 * @copyright  1997-2005 The PHP Group
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 * @version    CVS: $Id: observer.php,v 1.4 2005/07/25 13:02:33 farell Exp $
 * @link       http://pear.php.net/package/HTML_Progress
 */

/**
 * The HTML_Progress_Observer implements the observer pattern
 * for watching progress bar activity and taking actions
 * on exceptional events.
 *
 * PHP versions 4 and 5
 *
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to license@php.net so we can mail you a copy immediately.
 *
 * @category   HTML
 * @package    HTML_Progress
 * @subpackage Progress_Observer
 * @author     Laurent Laville <pear@laurent-laville.org>
 * @copyright  1997-2005 The PHP Group
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 * @version    Release: 1.2.2
 * @link       http://pear.php.net/package/HTML_Progress
 */

class HTML_Progress_Observer
{
    /**
     * Instance-specific unique identification number.
     *
     * @var        integer
     * @since      1.0
     * @access     private
     */
    var $_id;

    /**
     * Creates a new basic HTML_Progress_Observer instance.
     *
     * @since      1.0
     * @access     public
     */
    function HTML_Progress_Observer()
    {
        $this->_id = md5(microtime());
    }

    /**
     * This is a stub method to make sure that HTML_Progress_Observer classes do
     * something when they are notified of a message.  The default behavior
     * is to just write into a file 'progress_observer.log' in current directory.
     * You should override this method.
     *
     * Default events :
     * - setMinimum
     * - setMaximum
     * - setValue
     *
     * @param      mixed     $event         A hash describing the progress event.
     * @since      1.0
     * @access     public
     */
    function notify($event)
    {
        $msg = (is_array($event)) ? serialize($event) : $event;
        error_log ("$msg \n", 3, 'progress_observer.log');
    }
}

?>
Back to Top