From c62c0602feb720fb8c198ea0362c3292bab38415 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Tue, 3 Feb 2009 21:29:06 +0000 Subject: Added PEAR Services/oEmbed and its dependencies for multimedia integration. --- extlib/HTTP/Request/Listener.php | 106 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 extlib/HTTP/Request/Listener.php (limited to 'extlib/HTTP/Request') diff --git a/extlib/HTTP/Request/Listener.php b/extlib/HTTP/Request/Listener.php new file mode 100644 index 000000000..b4fe444b3 --- /dev/null +++ b/extlib/HTTP/Request/Listener.php @@ -0,0 +1,106 @@ + + * @copyright 2002-2007 Richard Heyes + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Listener.php,v 1.3 2007/05/18 10:33:31 avb Exp $ + * @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); + } + } +} +?> -- cgit v1.2.3-54-g00ecf