PHP 클래스 Scalr\Api\Rest\ApiApplication

부터: 5.4.0 (21.02.2015)
저자: Vitaliy Demidov ([email protected])
상속: extends Application
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

보호된 프로퍼티들

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