web/lib/Zend/Service/ShortUrl/AbstractShortener.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Service_ShortUrl
    16  * @package    Zend_Service_ShortUrl
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: $
    19  * @version    $Id: $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    30 require_once 'Zend/Service/ShortUrl/Shortener.php';
    30 require_once 'Zend/Service/ShortUrl/Shortener.php';
    31 
    31 
    32 /**
    32 /**
    33  * @category   Zend
    33  * @category   Zend
    34  * @package    Zend_Service_ShortUrl
    34  * @package    Zend_Service_ShortUrl
    35  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    35  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    36  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  */
    37  */
    38 abstract class Zend_Service_ShortUrl_AbstractShortener
    38 abstract class Zend_Service_ShortUrl_AbstractShortener
    39     extends Zend_Service_Abstract 
    39     extends Zend_Service_Abstract
    40     implements Zend_Service_ShortUrl_Shortener
    40     implements Zend_Service_ShortUrl_Shortener
    41 {
    41 {
    42     /**
    42     /**
    43      * Base URI of the service
    43      * Base URI of the service
    44      *
    44      *
    45      * @var string
    45      * @var string
    46      */
    46      */
    47     protected $_baseUri = null;
    47     protected $_baseUri = null;
    48 
    48 
    49     
    49 
    50     /**
    50     /**
    51      * Checks whether URL to be shortened is valid
    51      * Checks whether URL to be shortened is valid
    52      *
    52      *
    53      * @param string $url
    53      * @param string $url
    54      * @throws Zend_Service_ShortUrl_Exception When URL is not valid
    54      * @throws Zend_Service_ShortUrl_Exception When URL is not valid
    61             throw new Zend_Service_ShortUrl_Exception(sprintf(
    61             throw new Zend_Service_ShortUrl_Exception(sprintf(
    62                 'The url "%s" is not valid and cannot be shortened', $url
    62                 'The url "%s" is not valid and cannot be shortened', $url
    63             ));
    63             ));
    64         }
    64         }
    65     }
    65     }
    66     
    66 
    67     /**
    67     /**
    68      * Verifies that the URL has been shortened by this service
    68      * Verifies that the URL has been shortened by this service
    69      *
    69      *
    70      * @throws Zend_Service_ShortUrl_Exception If the URL hasn't been shortened by this service
    70      * @throws Zend_Service_ShortUrl_Exception If the URL hasn't been shortened by this service
    71      * @param string $shortenedUrl
    71      * @param string $shortenedUrl