PHP Класс Horde_Service_Scribd, horde

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

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

Свойство Тип Описание
$_config array
$_httpClient Horde_Http_Client HTTP client object to use for accessing the Scribd API.

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

Метод Описание
__construct ( $config ) Constructor
changeSettings ( mixed $docIds, array $settings ) : true Change a document's settings.
delete ( integer $docId ) : true Delete a document.
getConversionStatus ( integer $docId ) : string Get the current conversion status of a document.
getHttpClient ( ) : Horde_Http_Client Gets the HTTP client object.
getList ( ) : Traversable Return an iterator over the authorized user's documents.
getSettings ( integer $docId ) : array Get a document's settings
login ( string $username, string $password ) : array Log in as a user
newRequest ( string $method, string $args = [] ) : Horde_Service_Scribd_Request Create an API request for $method with $args
search ( string $query, integer $num_results = null, integer $num_start = null, string $scope = null ) : array Search the Scribd database
setHttpClient ( Horde_Http_Client $httpClient ) Set the HTTP client instance
signup ( string $username, string $password, string $email, string $name = null ) : array Sign up a new user
upload ( string $file, $doc_type = null, string $access = null, $revId = null ) : array Upload a local file.
uploadFromUrl ( string $url, $doc_type = null, string $access = null, integer $rev_id = null ) : array Upload a document from a publicly accessible URL.

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

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

Constructor
public __construct ( $config )

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

Change a document's settings.
public changeSettings ( mixed $docIds, array $settings ) : true
$docIds mixed One or more document ids to change.
$settings array The values to set for each $docId. Possible keys: title: string description: string access: ["public", "private"] license: ["by", "by-nc", "by-nc-nd", "by-nc-sa", "by-nd", "by-sa", "c", "pd" show_ads: ["default", "true", "false"] link_back_url: string tags: comma-separated stringlist (or PHP array)
Результат true

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

Delete a document.
public delete ( integer $docId ) : true
$docId integer The document to delete
Результат true

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

Get the current conversion status of a document.
public getConversionStatus ( integer $docId ) : string
$docId integer Document id to get status for
Результат string "DISPLAYABLE", "DONE", "ERROR", or "PROCESSING"

getHttpClient() публичный статический Метод

Gets the HTTP client object.
public static getHttpClient ( ) : Horde_Http_Client
Результат Horde_Http_Client

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

Return an iterator over the authorized user's documents.
public getList ( ) : Traversable
Результат Traversable

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

Get a document's settings
public getSettings ( integer $docId ) : array
$docId integer Document id to get status for
Результат array [doc_id, title, description, access, license, tags[], show_ads, access_key, thumbnail_url, secret_password]

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

Log in as a user
public login ( string $username, string $password ) : array
$username string : username of user to log in
$password string : password of user to log in
Результат array containing session_key, name, username, and user_id of the user

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

Create an API request for $method with $args
public newRequest ( string $method, string $args = [] ) : Horde_Service_Scribd_Request
$method string The API method to call.
$args string Method arguments
Результат Horde_Service_Scribd_Request

setHttpClient() публичный статический Метод

Sets the HTTP client object to use for Scribd requests. If none is set, the default Horde_Http_Client will be used.
public static setHttpClient ( Horde_Http_Client $httpClient )
$httpClient Horde_Http_Client

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

Sign up a new user
public signup ( string $username, string $password, string $email, string $name = null ) : array
$username string : username of user to create
$password string : password of user to create
$email string : email address of user
$name string : name of user
Результат array containing session_key, name, username, and user_id of the user

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

Upload a local file.
public upload ( string $file, $doc_type = null, string $access = null, $revId = null ) : array
$file string Local file
$access string Document visibility. 'public' or 'private', default 'public'
Результат array [doc_id, access_key, [secret_password]]

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

Upload a document from a publicly accessible URL.
public uploadFromUrl ( string $url, $doc_type = null, string $access = null, integer $rev_id = null ) : array
$url string Document location
$access string Document visibility. 'public' or 'private', default 'public'
$rev_id integer The doc_id to save uploaded file as a revision to
Результат array [doc_id, access_key, [secret_password]]

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

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

protected array $_config
Результат array

$_httpClient защищенное статическое свойство

HTTP client object to use for accessing the Scribd API.
protected static Horde_Http_Client $_httpClient
Результат Horde_Http_Client