PHP Класс Jackalope\Transport\Jackrabbit\Request

Автор: Christian Stocker ([email protected])
Автор: David Buchmann ([email protected])
Автор: Roland Schilter ([email protected])
Автор: Jordi Boggiano ([email protected])
Автор: Lukas Kahwe Smith ([email protected])
Автор: Markus Schmucker ([email protected])
Показать файл Открыть проект

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

Свойство Тип Описание
$additionalHeaders
$body string Posted content for methods that require it
$client Client
$contentType string Request content-type
$credentials PHPCR\CredentialsInterface Set of credentials necessary to connect to the server or else.
$curl Jackalope\Transport\Jackrabbit\curl
$depth integer How far the request should go, default is 0
$errorHandlingMode boolean Whether we are in error handling mode to prevent infinite recursion
$lockToken string | FALSE The lock token active for this request otherwise FALSE for no locking
$method string Name of the request method to be used.
$uri array .
$versionChecked boolean Doing this once per php process is enough.

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

Метод Описание
__construct ( Jackalope\FactoryInterface $factory, Client $client, Jackalope\Transport\Jackrabbit\curl $curl, string $method, string | array $uri ) Initiaties the NodeTypes request object.
addCurlOptions ( array $options ) Add curl-options for this request.
addHeader ( string $header ) add an additional http header
addUserData ( string $userData ) Add the user data header
execute ( boolean $getCurlObject = false, boolean $forceMultiple = false ) : string | Jackalope\Transport\Jackrabbit\curl | array Requests the data to be identified by a formerly prepared request.
executeDom ( boolean $forceMultiple = false ) : DOMDocument Loads the response into an DOMDocument.
executeJson ( boolean $forceMultiple = false ) : mixed Loads the server response as a json string.
forceHttpVersion10 ( ) Force curl to use HTTP version 1.0
setBody ( string $body ) Set the request body
setContentType ( string $contentType ) Set a different content type for this request. The default is text/xml in utf-8
setCredentials ( PHPCR\CredentialsInterface $creds = null ) Set the credentials for the request. Setting them to null will make a request without authentication header.
setDepth ( integer | string $depth ) Set the depth to which nodes should be fetched.
setLockToken ( string $lockToken ) Set the transaction lock token to be used with this request
setMethod ( string $method ) Set or update the HTTP method to be used in this request.
setUri ( string | array $uri )

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

Метод Описание
getLongErrorString ( Jackalope\Transport\Jackrabbit\curl $curl, string $response ) : string returns a longer error string to be used in generic exceptions
getShortErrorString ( ) : string returns a shorter error string to be used in exceptions
handleError ( Jackalope\Transport\Jackrabbit\curl $curl, string $response, integer $httpCode ) Handles errors caused by singleRequest and multiRequest
multiRequest ( boolean $getCurlObject = false ) : array Requests the data for multiple requests
prepareCurl ( Jackalope\Transport\Jackrabbit\curl $curl, boolean $getCurlObject ) used by multiCurl with fresh curl instances
singleRequest ( boolean $getCurlObject ) : string | Jackalope\Transport\Jackrabbit\curl Requests the data for a single requests

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

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

Initiaties the NodeTypes request object.
public __construct ( Jackalope\FactoryInterface $factory, Client $client, Jackalope\Transport\Jackrabbit\curl $curl, string $method, string | array $uri )
$factory Jackalope\FactoryInterface Ignored for now, as this class does not create objects
$client Client The jackrabbit client instance
$curl Jackalope\Transport\Jackrabbit\curl The cURL object to use in this request
$method string the HTTP method to use, one of the class constants
$uri string | array the remote url for this request, including protocol, host name, workspace and path to the object to manipulate. May be an array of uri

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

Add curl-options for this request.
public addCurlOptions ( array $options )
$options array

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

add an additional http header
public addHeader ( string $header )
$header string HTTP header

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

Add the user data header
public addUserData ( string $userData )
$userData string

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

Prepares the curl object, executes it and checks for transport level errors, throwing the appropriate exceptions.
public execute ( boolean $getCurlObject = false, boolean $forceMultiple = false ) : string | Jackalope\Transport\Jackrabbit\curl | array
$getCurlObject boolean wheter to return the curl object instead of the response
$forceMultiple boolean whether to force parallel requests or not
Результат string | Jackalope\Transport\Jackrabbit\curl | array response string or the curl object.

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

Returns a DOMDocument from the backend or throws exception. Does error handling for both connection errors and dcr:exception response
public executeDom ( boolean $forceMultiple = false ) : DOMDocument
$forceMultiple boolean whether to force parallel requests or not
Результат DOMDocument The loaded XML response text.

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

Returns a decoded json string from the backend or throws exception
public executeJson ( boolean $forceMultiple = false ) : mixed
$forceMultiple boolean whether to force parallel requests or not
Результат mixed

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

Force curl to use HTTP version 1.0
Устаревший: use addCurlOptions([CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_0]) instead
public forceHttpVersion10 ( )

getLongErrorString() защищенный Метод

It returns a "nicely" formatted URI of the request plus the output of curl_getinfo plus the response body including its size
protected getLongErrorString ( Jackalope\Transport\Jackrabbit\curl $curl, string $response ) : string
$curl Jackalope\Transport\Jackrabbit\curl The curl object
$response string the response body
Результат string the error message

getShortErrorString() защищенный Метод

It returns a "nicely" formatted URI of the request
protected getShortErrorString ( ) : string
Результат string the error message

handleError() защищенный Метод

For transport level errors, tries to figure out what went wrong to throw the most appropriate exception.
protected handleError ( Jackalope\Transport\Jackrabbit\curl $curl, string $response, integer $httpCode )
$curl Jackalope\Transport\Jackrabbit\curl
$response string the response body
$httpCode integer the http response code

multiRequest() защищенный Метод

Requests the data for multiple requests
protected multiRequest ( boolean $getCurlObject = false ) : array
$getCurlObject boolean whether to return the curl object instead of the response
Результат array of XML representations of responses or curl objects.

prepareCurl() защищенный Метод

used by multiCurl with fresh curl instances
protected prepareCurl ( Jackalope\Transport\Jackrabbit\curl $curl, boolean $getCurlObject )
$curl Jackalope\Transport\Jackrabbit\curl
$getCurlObject boolean whether to return the curl object instead of the response

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

Set the request body
public setBody ( string $body )
$body string

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

Set a different content type for this request. The default is text/xml in utf-8
public setContentType ( string $contentType )
$contentType string

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

Set the credentials for the request. Setting them to null will make a request without authentication header.
public setCredentials ( PHPCR\CredentialsInterface $creds = null )
$creds PHPCR\CredentialsInterface the credentials to use in the request.

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

To support more than 0, we need to implement more logic in parsing the response too.
public setDepth ( integer | string $depth )
$depth integer | string

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

Set the transaction lock token to be used with this request
public setLockToken ( string $lockToken )
$lockToken string the transaction lock

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

Set or update the HTTP method to be used in this request.
public setMethod ( string $method )
$method string the HTTP method to use, one of the class constants

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

public setUri ( string | array $uri )
$uri string | array the request target

singleRequest() защищенный Метод

Requests the data for a single requests
protected singleRequest ( boolean $getCurlObject ) : string | Jackalope\Transport\Jackrabbit\curl
$getCurlObject boolean whether to return the curl object instead of the response
Результат string | Jackalope\Transport\Jackrabbit\curl XML representation of a response or curl object.

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

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

protected $additionalHeaders

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

Posted content for methods that require it
protected string $body
Результат string

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

protected Client,Jackalope\Transport\Jackrabbit $client
Результат Client

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

Request content-type
protected string $contentType
Результат string

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

Set of credentials necessary to connect to the server or else.
protected CredentialsInterface,PHPCR $credentials
Результат PHPCR\CredentialsInterface

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

protected curl,Jackalope\Transport\Jackrabbit $curl
Результат Jackalope\Transport\Jackrabbit\curl

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

How far the request should go, default is 0
protected int $depth
Результат integer

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

Whether we are in error handling mode to prevent infinite recursion
protected bool $errorHandlingMode
Результат boolean

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

The lock token active for this request otherwise FALSE for no locking
protected string|FALSE $lockToken
Результат string | FALSE

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

Name of the request method to be used.
protected string $method
Результат string

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

.
protected array $uri
Результат array

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

Doing this once per php process is enough.
protected static bool $versionChecked
Результат boolean