PHP Класс Phergie_Plugin_Url_Shorten_Abstract, phergie

Автор: Phergie Development Team ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$http
$minimumLength

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
getRequestParams ( string $url ) : array Returns an array of request parameters given a url to shorten. The following keys are valid request parameters:

Описание методов

__construct() публичный Метод

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

getMinimumLength() публичный Метод

Returns the minimum length that a url must be before it is shortened by the current service.
public getMinimumLength ( ) : integer
Результат integer

getRequestParams() абстрактный защищенный Метод

* '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
Результат array the request parameters

shorten() публичный Метод

Shortens a given url.
public shorten ( string $url ) : string
$url string the url to shorten
Результат string the shortened url or false on a failure

Описание свойств

$http защищенное свойство

protected $http

$minimumLength защищенное свойство

protected $minimumLength