]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/HTTP/Request/Listener.php
Added PEAR Services/oEmbed and its dependencies for multimedia integration.
[quix0rs-gnu-social.git] / extlib / HTTP / Request / Listener.php
diff --git a/extlib/HTTP/Request/Listener.php b/extlib/HTTP/Request/Listener.php
new file mode 100644 (file)
index 0000000..b4fe444
--- /dev/null
@@ -0,0 +1,106 @@
+<?php\r
+/**\r
+ * Listener for HTTP_Request and HTTP_Response objects\r
+ *\r
+ * PHP versions 4 and 5\r
+ * \r
+ * LICENSE:\r
+ *\r
+ * Copyright (c) 2002-2007, Richard Heyes\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * o Redistributions of source code must retain the above copyright\r
+ *   notice, this list of conditions and the following disclaimer.\r
+ * o Redistributions in binary form must reproduce the above copyright\r
+ *   notice, this list of conditions and the following disclaimer in the\r
+ *   documentation and/or other materials provided with the distribution.\r
+ * o The names of the authors may not be used to endorse or promote\r
+ *   products derived from this software without specific prior written\r
+ *   permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ * @category    HTTP\r
+ * @package     HTTP_Request\r
+ * @author      Alexey Borzov <avb@php.net>\r
+ * @copyright   2002-2007 Richard Heyes\r
+ * @license     http://opensource.org/licenses/bsd-license.php New BSD License\r
+ * @version     CVS: $Id: Listener.php,v 1.3 2007/05/18 10:33:31 avb Exp $\r
+ * @link        http://pear.php.net/package/HTTP_Request/ \r
+ */\r
+\r
+/**\r
+ * Listener for HTTP_Request and HTTP_Response objects\r
+ *\r
+ * This class implements the Observer part of a Subject-Observer\r
+ * design pattern.\r
+ *\r
+ * @category    HTTP\r
+ * @package     HTTP_Request\r
+ * @author      Alexey Borzov <avb@php.net>\r
+ * @version     Release: 1.4.4\r
+ */\r
+class HTTP_Request_Listener \r
+{\r
+   /**\r
+    * A listener's identifier\r
+    * @var string\r
+    */\r
+    var $_id;\r
+\r
+   /**\r
+    * Constructor, sets the object's identifier\r
+    *\r
+    * @access public\r
+    */\r
+    function HTTP_Request_Listener()\r
+    {\r
+        $this->_id = md5(uniqid('http_request_', 1));\r
+    }\r
+\r
+\r
+   /**\r
+    * Returns the listener's identifier\r
+    *\r
+    * @access public\r
+    * @return string\r
+    */\r
+    function getId()\r
+    {\r
+        return $this->_id;\r
+    }\r
+\r
+\r
+   /**\r
+    * This method is called when Listener is notified of an event\r
+    *\r
+    * @access   public\r
+    * @param    object  an object the listener is attached to\r
+    * @param    string  Event name\r
+    * @param    mixed   Additional data\r
+    * @abstract\r
+    */\r
+    function update(&$subject, $event, $data = null)\r
+    {\r
+        echo "Notified of event: '$event'\n";\r
+        if (null !== $data) {\r
+            echo "Additional data: ";\r
+            var_dump($data);\r
+        }\r
+    }\r
+}\r
+?>\r