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])
파일 보기 프로젝트 열기: jackalope/jackalope-jackrabbit

보호된 프로퍼티들

프로퍼티 타입 설명
$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