PHP Класс Scalr\Api\Rest\ApiApplication

С версии: 5.4.0 (21.02.2015)
Автор: Vitaliy Demidov ([email protected])
Наследование: extends Application
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$limiter Scalr\Api\Limiter API rate limiter

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

Метод Описание
__construct ( array $settings = [] )
authenticationMiddleware ( ) Authentication middleware
checkPermissions ( $args ) Checks whether the authenticated user either is authorized to the specified object or has permission to ACL Role
delete ( $path, $options, $requirements = [] )
environmentAuthenticationMiddleware ( ) Environment level authentication middleware
error ( $e = null )
get ( $path, $options, $requirements = [] )
getAuditLoggerConfig ( )
getDefaultSettings ( ) Gets default settings
getEnvironment ( ) : Environment Gets User's Environment
getErrorEnvelope ( ) : Scalr\Api\DataType\ErrorEnvelope Gets API error envelope
getRouteHandler ( string $name ) : callable Gets the callback for the handler of the specified Route
getScope ( ) : string Gets current API request scope
getUser ( ) : User Gets authorized user
handleApiVersion ( $route )
handleEnvironment ( Scalr\Api\Rest\Routing\Route $route ) Scalr-Evironment middleware handler
hasPermissions ( ) : boolean Checks whether the authenticated user either is authorized to the specified object or has permission to ACL Role
invokeRoute ( string $name ) : mixed Invokes the named route with the list of the arguments and returns the result
notFound ( )
patch ( $path, $options, $requirements = [] )
post ( $path, $options, $requirements = [] )
preflightRequestHandlerMiddleware ( ) Preflight request middleware handler
put ( $path, $options, $requirements = [] )
redirectTo ( string $route, array $params = [], number $status = 302 ) Redirects to the specified named route
setEnvironment ( Environment $environment ) : ApiApplication Sets User's Environment
setUser ( User $user ) : ApiApplication Sets authorized user
setupRoutes ( ) : ApiApplication Sets up all API routes

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

Метод Описание
defaultError ( $e = null )

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

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

См. также: Scalr\Api\Rest\Application::__construct()
public __construct ( array $settings = [] )
$settings array

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

Authentication middleware

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

checkPermissions(object $obj, bool $modify = false, $errorMessage='') checkPermissions(int $roleId, string $permissionId = null, $errorMessage='')
public checkPermissions ( $args )

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

См. также: Scalr\Api\Rest\Application::defaultError()
protected defaultError ( $e = null )

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

См. также: Application::delete()
public delete ( $path, $options, $requirements = [] )

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

Environment level authentication middleware

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

См. также: Scalr\Api\Rest\Application::error()
public error ( $e = null )

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

См. также: Application::get()
public get ( $path, $options, $requirements = [] )

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

См. также: Scalr\LogCollector\AuditLoggerRetrieveConfigurationInterface::getAuditLoggerConfig()

getDefaultSettings() публичный статический Метод

Gets default settings
public static getDefaultSettings ( )

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

Gets User's Environment
public getEnvironment ( ) : Environment
Результат Scalr\Model\Entity\Account\Environment Returns Environment object

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

Gets API error envelope
public getErrorEnvelope ( ) : Scalr\Api\DataType\ErrorEnvelope
Результат Scalr\Api\DataType\ErrorEnvelope

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

Gets the callback for the handler of the specified Route
public getRouteHandler ( string $name ) : callable
$name string The description of the handler _:
Результат callable Returns the callable handler

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

Gets current API request scope
public getScope ( ) : string
Результат string Returns scope

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

Gets authorized user
public getUser ( ) : User
Результат Scalr\Model\Entity\Account\User Returns user object

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

См. также: Scalr\Api\Rest\Application::handleApiVersion()
public handleApiVersion ( $route )

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

It extracts :environment group parameter from the route and sets application setting
public handleEnvironment ( Scalr\Api\Rest\Routing\Route $route )
$route Scalr\Api\Rest\Routing\Route A route

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

hasPermissions(object $obj, bool $modify = false) hasPermissions(int $roleId, string $permissionId = null)
public hasPermissions ( ) : boolean
Результат boolean Returns TRUE if the authenticated user has access or FALSE otherwise

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

Invokes the named route with the list of the arguments and returns the result
public invokeRoute ( string $name ) : mixed
$name string The description of the handler _:
Результат mixed Returns the result of the invoked handler of the specified Route

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

См. также: Scalr\Api\Rest\Application::notFound()
public notFound ( )

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

См. также: Application::patch()
public patch ( $path, $options, $requirements = [] )

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

См. также: Application::post()
public post ( $path, $options, $requirements = [] )

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

Preflight request middleware handler

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

См. также: Application::put()
public put ( $path, $options, $requirements = [] )

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

Redirects to the specified named route
public redirectTo ( string $route, array $params = [], number $status = 302 )
$route string The name of the Route
$params array optional The list of the parameters
$status number optional The HTTP response status code.

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

Sets User's Environment
public setEnvironment ( Environment $environment ) : ApiApplication
$environment Scalr\Model\Entity\Account\Environment The Environment object
Результат ApiApplication

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

Sets authorized user
public setUser ( User $user ) : ApiApplication
$user Scalr\Model\Entity\Account\User The user object
Результат ApiApplication

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

Sets up all API routes
public setupRoutes ( ) : ApiApplication
Результат ApiApplication Returns current instance

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

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

API rate limiter
protected Limiter,Scalr\Api $limiter
Результат Scalr\Api\Limiter