\Pydio\Core\ControllerController

Core controller for dispatching the actions.

It uses the XML Registry (simple version, not extended) to search all the tags and find the action.

Summary

Methods
Properties
Constants
parseRestParameters()
registryActionMiddleware()
checkParams()
run()
executableRequest()
applyHook()
applyIncludeHook()
registerIncludeHook()
actionNeedsRight()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
initXPath()
getCallbackNode()
appliesCondition()
applyCallback()
handleRequest()
parseCallback()
$xPathes
$includeHooks
$hooksCaches
N/A

Properties

$xPathes

$xPathes : array<mixed,\DOMXPath>

Type

array<mixed,\DOMXPath>

$includeHooks

$includeHooks : array

Type

array

$hooksCaches

$hooksCaches : array

Type

array

Methods

parseRestParameters()

parseRestParameters(\Psr\Http\Message\ServerRequestInterface  $request) : boolean|\DOMElement

API V1 : parse parameters based on the URL and their definitions in the manifest.

Parameters

\Psr\Http\Message\ServerRequestInterface $request

Throws

\Pydio\Core\Exception\ActionNotFoundException

Returns

boolean|\DOMElement

registryActionMiddleware()

registryActionMiddleware(\Psr\Http\Message\ServerRequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response, callable|null  $nextCallable = null) : \Psr\Http\Message\ResponseInterface

Middleware entry point

Parameters

\Psr\Http\Message\ServerRequestInterface $request
\Psr\Http\Message\ResponseInterface $response
callable|null $nextCallable

Throws

\Pydio\Core\Exception\AuthRequiredException

Returns

\Psr\Http\Message\ResponseInterface

checkParams()

checkParams(array  $parameters, \DOMNode  $callbackNode, \DOMXPath  $xPath) 

Check if mandatory parameters as defined in the manifests are correct.

Parameters

array $parameters
\DOMNode $callbackNode
\DOMXPath $xPath

Throws

\Exception

run()

run(\Psr\Http\Message\ServerRequestInterface  $request, \DOMNode  $actionNode = null) : \Psr\Http\Message\ResponseInterface

Main method for querying the XML registry, find an action and all its associated processors, and apply all the callbacks.

Parameters

\Psr\Http\Message\ServerRequestInterface $request
\DOMNode $actionNode

Throws

\Exception

Returns

\Psr\Http\Message\ResponseInterface

executableRequest()

executableRequest(\Pydio\Core\Model\ContextInterface  $context, string  $action, array  $parameters = array()) : \Psr\Http\Message\ServerRequestInterface

Parameters

\Pydio\Core\Model\ContextInterface $context
string $action
array $parameters

Returns

\Psr\Http\Message\ServerRequestInterface

applyHook()

applyHook(string  $hookName, array  $args, boolean  $forceNonDefer = false) 

Find all callbacks registered for a given hook and apply them. Caches the hooks locally, on a per-context basis

Parameters

string $hookName
array $args
boolean $forceNonDefer

Throws

\Pydio\Core\Exception\PydioException
\Exception

applyIncludeHook()

applyIncludeHook(  $hookName,   $args) : void

Find the statically defined callbacks for a given hook and apply them

Parameters

$hookName
$args

registerIncludeHook()

registerIncludeHook(  $hookName,   $callback) : void

Register a hook statically when it must be defined before the XML registry construction.

Parameters

$hookName
$callback

actionNeedsRight()

actionNeedsRight(\DOMNode  $actionNode, \DOMXPath  $xPath, string  $right,   $expectedValue = "true") : boolean

Check the rightsContext node of an action.

Parameters

\DOMNode $actionNode
\DOMXPath $xPath
string $right
$expectedValue

Returns

boolean

initXPath()

initXPath(\Pydio\Core\Model\ContextInterface  $ctx, boolean  $useCache = false) : \DOMXPath

Initialize the queryable xPath object, pointing to the registry associated with the current context

Parameters

\Pydio\Core\Model\ContextInterface $ctx
boolean $useCache

Whether to cache the registry version in a memory cache.

Returns

\DOMXPath

getCallbackNode()

getCallbackNode(\DOMXPath  $xPath, \DOMNode  $actionNode, string  $query, string  $actionName, array  $httpVars, array  $fileVars, boolean  $multiple = true) : array<mixed,\DOMElement>

Find a callback node by its xpath query, filtering with the applyCondition if the xml attribute exists.

Parameters

\DOMXPath $xPath
\DOMNode $actionNode
string $query
string $actionName
array $httpVars
array $fileVars
boolean $multiple

Returns

array<mixed,\DOMElement>

appliesCondition()

appliesCondition(\DOMElement|\DOMNode  $callback, string  $actionName, array  $httpVars, array  $fileVars) : boolean

Check in the callback node if an applyCondition XML attribute exists, and eval its content.

The content must set an $apply boolean as result

Parameters

\DOMElement|\DOMNode $callback
string $actionName
array $httpVars
array $fileVars

Returns

boolean

applyCallback()

applyCallback(\Pydio\Core\Model\ContextInterface  $context, \DOMElement|array  $callback, null  $variableArgs, boolean  $defer = false) : mixed

Applies a callback node

Parameters

\Pydio\Core\Model\ContextInterface $context
\DOMElement|array $callback

The DOM Node or directly an array of attributes

null $variableArgs
boolean $defer

Throws

\Pydio\Core\Exception\PydioException

Returns

mixed

handleRequest()

handleRequest(  $callback, \Psr\Http\Message\ServerRequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) 

Parameters

$callback
\Psr\Http\Message\ServerRequestInterface $request
\Psr\Http\Message\ResponseInterface $response

Throws

\Pydio\Core\Exception\PydioException

parseCallback()

parseCallback(\Pydio\Core\Model\ContextInterface  $ctx, \DOMElement|array  $callback) : array

Parameters

\Pydio\Core\Model\ContextInterface $ctx
\DOMElement|array $callback

Throws

\Pydio\Core\Exception\PydioException

Returns

array