Property | Type | Description | |
---|---|---|---|
$startTime | float | API Application start time |
Property | Type | Description | |
---|---|---|---|
$pathPreprocessor | callable | Preprocess request method and path |
Method | Description | |
---|---|---|
__construct ( array $settings = [] ) | Constructor | |
__get ( $name ) | ||
__isset ( $name ) | ||
addRoute ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds a route to routing table | |
call ( ) | Application wide handler | |
delete ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds delete route | |
error ( Callable | Exception $e = null ) | Error handler | |
get ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds get route | |
getContainer ( ) : |
Gets API Container | |
getDefaultSettings ( ) | ||
getRouteUrl ( string $route, array $params = [] ) : string | Gets url for the specified route | |
group ( ) | Route Groups | |
halt ( number $status, string $message = '' ) | Stops application immediately | |
handleApiVersion ( Scalr\Api\Rest\Routing\Route $route ) | ApiVersion middleware handler | |
handleErrors ( integer $errno, string $errstr, string $errfile, integer $errline ) : boolean | Error handler | |
notFound ( ) | Not found handler | |
options ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds options route | |
patch ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds patch route | |
post ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds post route | |
put ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | Adds put route | |
redirect ( string $url, number $status = 302 ) | Redirects to the specified url | |
redirectTo ( string $route, array $params = [], number $status = 302 ) | Redirects to the specified named route | |
run ( ) | Runs application | |
stop ( ) | Stops application |
Method | Description | |
---|---|---|
callErrorHandler ( Exception $e = null ) : string | Calls error handler | |
defaultError ( ErrorException $e = null ) : string | Gets default error content | |
getDefaultTemplate ( string $title, string $body ) : string | Parses default template and returns its content |
public __construct ( array $settings = [] ) | ||
$settings | array | optional Application settings |
public addRoute ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | ||
$path | string | The path pattern of the route |
$options | array | callable | The options |
$requirements | array | optional The requirements |
return | Scalr\Api\Rest\Routing\Route | Returns route instance |
protected callErrorHandler ( Exception $e = null ) : string | ||
$e | Exception | optional An exception |
return | string |
protected defaultError ( ErrorException $e = null ) : string | ||
$e | ErrorException | optional An Exception |
return | string |
public delete ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | ||
$path | string | The path pattern of the route |
$options | array | callable | The options |
$requirements | array | optional The requirements |
return | Scalr\Api\Rest\Routing\Route | Returns route instance |
public error ( Callable | Exception $e = null ) | ||
$e | Callable | Exception | optional Either the callable handler or exception |
public getContainer ( ) : |
||
return | Returns DI Container instance |
public handleApiVersion ( Scalr\Api\Rest\Routing\Route $route ) | ||
$route | Scalr\Api\Rest\Routing\Route | A route |
public options ( string $path, array | callable $options, array $requirements = [] ) : Scalr\Api\Rest\Routing\Route | ||
$path | string | The path pattern of the route |
$options | array | callable | The options |
$requirements | array | optional The requirements |
return | Scalr\Api\Rest\Routing\Route | Returns route instance |
protected callable $pathPreprocessor | ||
return | callable |