
* Milestone 4: Initial documentation exists.
{zone-data}
{zone-data:class-list}
* Zend_Service_Longurl
* Zend_Service_Longurl_Exception
{zone-data}
{zone-data:use-cases}
||UC-01||
Retrieve the list of known URL shortening services in serialized php format.
{code}
$longurlservice = new Zend_Service_Longurl();
$longurlservice->setResponseType('php');
$response = $longurlservice->services();
{code}
||UC-02||
Retrieve the long url, include the HTML title and internet media type of the destination URL in the response in XML format.
{code}
$longurlservice = new Zend_Service_Longurl();
$response = $longurlservice->expandUrl(array('url' => 'http://is.gd/w', 'title' => true, 'content-type' => true, 'format' => 'xml'));
{code}
{zone-data}
{zone-data:skeletons}
{code}
class Zend_Service_Longurl extends Zend_Rest_Client
{
/**
* Response Type
* @var String
*/
protected $_responseType = 'xml';
/**
* Response Format Types
* @var array
*/
protected $_responseTypes = array(
'json',
'php',
'xml'
);
/**
* Uri Component
*
* @var Zend_Uri_Http
*/
protected $_uri;
/**
* Constructor
*
* @param string $returnType
* @return void
*/
public function __construct($responseType = 'xml')
{
}
/**
* set responseType
*
* @param string $responseType
* @throws Zend_Service_Longurl_Exception
* @return Zend_Service_Longurl
*/
public function setResponseType($responseType = 'xml')
{
}
/**
* Retrieve responseType
*
* @return string
*/
public function getResponseType()
{
}
/**
* Get the available services
*
* @param array $params
* @throws Zend_Http_Client_Exception
* @return mixed
*/
public function services(array $params = array())
{
}
/**
* Expand an url
*
* @param array $params
* @throws Zend_Http_Client_Exception
* @return mixed
*/
public function expandUrl(array $params = array())
{
}
}
class Zend_Service_Longurl_Exception extends Zend_Service_Exception
{
}
{code}
{zone-data}
{zone-template-instance}