* @copyright 2002-2007 Richard Heyes * @license http://opensource.org/licenses/bsd-license.php New BSD License * @version CVS: $Id$ * @link http://pear.php.net/package/HTTP_Request/ */ /** * Listener for HTTP_Request and HTTP_Response objects * * This class implements the Observer part of a Subject-Observer * design pattern. * * @category HTTP * @package HTTP_Request * @author Alexey Borzov * @version Release: 1.4.4 */ class HTTP_Request_Listener { /** * A listener's identifier * @var string */ var $_id; /** * Constructor, sets the object's identifier * * @access public */ function HTTP_Request_Listener() { $this->_id = md5(uniqid('http_request_', 1)); } /** * Returns the listener's identifier * * @access public * @return string */ function getId() { return $this->_id; } /** * This method is called when Listener is notified of an event * * @access public * @param object an object the listener is attached to * @param string Event name * @param mixed Additional data * @abstract */ function update(&$subject, $event, $data = null) { echo "Notified of event: '$event'\n"; if (null !== $data) { echo "Additional data: "; var_dump($data); } } } ?>