PHP Class Phergie_Plugin_Url_Shorten_Abstract, phergie

Author: Phergie Development Team ([email protected])
Afficher le fichier Open project: phergie/phergie Class Usage Examples

Protected Properties

Свойство Type Description
$http
$minimumLength

Méthodes publiques

Méthode Description
__construct ( Phergie_Plugin_Http $http ) Constructor
getMinimumLength ( ) : integer Returns the minimum length that a url must be before it is shortened by the current service.
shorten ( string $url ) : string Shortens a given url.

Méthodes protégées

Méthode Description
getRequestParams ( string $url ) : array Returns an array of request parameters given a url to shorten. The following keys are valid request parameters:

Method Details

__construct() public méthode

Constructor
public __construct ( Phergie_Plugin_Http $http )
$http Phergie_Plugin_Http instance of the http plugin

getMinimumLength() public méthode

Returns the minimum length that a url must be before it is shortened by the current service.
public getMinimumLength ( ) : integer
Résultat integer

getRequestParams() abstract protected méthode

* 'uri': the URI for the request (required) * 'query': an array of key-value pairs sent in a GET request * 'post': an array of key-value pairs sent in a POST request * 'callback': to be called after the request is finished. Should accept a Phergie_Plugin_Http_Response object and return either the shortened url or false if an error has occured. If the 'post' key is present a POST request shall be made; otherwise a GET request will be made. The 'post' key can be an empty array and a post request will still be made. If no callback is provided the contents of the response will be returned.
abstract protected getRequestParams ( string $url ) : array
$url string the url to shorten
Résultat array the request parameters

shorten() public méthode

Shortens a given url.
public shorten ( string $url ) : string
$url string the url to shorten
Résultat string the shortened url or false on a failure

Property Details

$http protected_oe property

protected $http

$minimumLength protected_oe property

protected $minimumLength