\Pydio\Core\Http\RestApiRouter

Class ApiRouter Router used for REST API v1 and REST API v2.

Based on fast-route, creates route for api/v1 using XML declaration, and routes for api/v2 using swagger file.

Summary

Methods
Properties
Constants
__construct()
configureRoutes()
getURIForRequest()
route()
No public properties found
No constants found
findRepositoryInParameters()
No protected properties found
N/A
No private methods found
$base
$cacheOptions
$v2Base
$v1Base
N/A

Properties

$base

$base : array

Type

array

$cacheOptions

$cacheOptions : array

Type

array — "cacheOptions" => ["cacheFile" => "path", "cacheDisabled" => true],

$v2Base

$v2Base : 

Type

$v1Base

$v1Base : 

Type

Methods

__construct()

__construct(string  $base, array  $cacheOptions = array()) 

ApiRouter constructor.

Parameters

string $base
array $cacheOptions

configureRoutes()

configureRoutes(\FastRoute\RouteCollector  $r) 

Parameters

\FastRoute\RouteCollector $r

getURIForRequest()

getURIForRequest(\Psr\Http\Message\ServerRequestInterface  $request) : string

Get Path component of the URI, without query parameters

Parameters

\Psr\Http\Message\ServerRequestInterface $request

Returns

string

route()

route(\Psr\Http\Message\ServerRequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) : boolean

Find a route in api definitions

Parameters

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

Returns

boolean

findRepositoryInParameters()

findRepositoryInParameters(\Psr\Http\Message\ServerRequestInterface  $request, array  $pathVars) : mixed|string

Analyze URI and parameters to guess the current workspace

Parameters

\Psr\Http\Message\ServerRequestInterface $request
array $pathVars

Returns

mixed|string