From: Michael J. Rubinsky Date: Sat, 27 Dec 2008 02:24:18 +0000 (-0500) Subject: Use Horde_Http_Client in place of HTTP_Response X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e77602009e8384868dc651c5f334cc5a87d587bf;p=horde.git Use Horde_Http_Client in place of HTTP_Response --- diff --git a/framework/Service_Vimeo/lib/Horde/Service/Vimeo.php b/framework/Service_Vimeo/lib/Horde/Service/Vimeo.php index 1801f5df2..9f723a03b 100644 --- a/framework/Service_Vimeo/lib/Horde/Service/Vimeo.php +++ b/framework/Service_Vimeo/lib/Horde/Service/Vimeo.php @@ -14,7 +14,7 @@ require_once 'HTTP/Request.php'; * * @author Michael J. Rubinsky */ -class Service_Vimeo { +class Horde_Service_Vimeo { protected $_format = 'php'; @@ -57,7 +57,7 @@ class Service_Vimeo { $driver = basename($driver); include_once dirname(__FILE__) . '/Vimeo/' . $driver . '.php'; - $class = 'Horde_Services_Vimeo_' . $driver; + $class = 'Horde_Service_Vimeo_' . $driver; if (class_exists($class)) { return new $class($params); } else { diff --git a/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php b/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php index b4cce91ff..129d4b5b7 100644 --- a/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php +++ b/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php @@ -10,7 +10,7 @@ * * @author Michael J. Rubinsky */ -class Service_Vimeo_Simple extends Service_Vimeo { +class Horde_Service_Vimeo_Simple extends Horde_Service_Vimeo { protected $_api_endpoint = 'http://www.vimeo.com/api/'; protected $_oembed_endpoint = 'http://www.vimeo.com/api/oembed.json'; @@ -30,10 +30,6 @@ class Service_Vimeo_Simple extends Service_Vimeo { * * Groups * groupClips: clips in this group - * - * - * - * @param unknown_type $criteria */ public function getClips($criteria) { @@ -45,12 +41,9 @@ class Service_Vimeo_Simple extends Service_Vimeo { break; } - $req = new HTTP_Request($this->_api_endpoint . $method); - if (is_a($req, 'PEAR_Error')) { - return $req; - } - $req->sendRequest(); - return $req->getResponseBody(); + $req = $this->getHttpClient(); + $response = $req->request('GET', $this->_api_endpoint . $method); + return $response->getBody(); } public function getActivity($criteria) @@ -81,14 +74,11 @@ class Service_Vimeo_Simple extends Service_Vimeo { public function getEmbedJSON($clipUrl) { $url = $this->_oembed_endpoint . '?url=' . rawurlencode($clipUrl); - $req = new HTTP_Request($url); - //@TODO: We should probably throw an exception here. - if (is_a($req, 'PEAR_Error')) { - return $req; - } - $req->sendRequest(); - $response = $req->getResponseBody(); - return $response; + $req = $this->getHttpClient(); + $response = $req->request('GET', $url); + $results = $response->getBody(); + + return $results; } } \ No newline at end of file diff --git a/framework/Service_Vimeo/package.xml b/framework/Service_Vimeo/package.xml new file mode 100644 index 000000000..78e711067 --- /dev/null +++ b/framework/Service_Vimeo/package.xml @@ -0,0 +1,64 @@ + + + Service_Vimeo + pear.horde.org + Horde Vimeo client + This package provides client libraries for the Vimeo API + + + Michael J. Rubinsky + mrubinsk + mrubinsk@horde.org + yes + + 2008-12-26 + + 0.1.0 + 0.1.0 + + + alpha + alpha + + BSD + +* Initial release + + + + + + + + + + + + + + + + + + + 5.2.0 + + + 1.5.0 + + + Http_Client + pear.horde.org + + + + + + + + + +