Class flApiServer
flApiServer Class
Class to handle RESTful API requests.
Package: fusionLib
Copyright:
Copyright (c) 2013 fusionLib. All rights reserved.
Located at system/libs/Api/flApiServer.php
Methods summary
public
|
#
__construct( flDb $db )
Create the object.
Parameters
- $db
- The database object to use.
|
public
|
#
registerServiceClass( string $service, string $class )
Register the class to use for a service with the API server.
Register the class to use for a service with the API server.
Parameters
- $service
- The name of the service.
- $class
- The name of the class providing the service.
|
public
|
#
processRequest( flRequest $request, flResponse $response )
Process the request.
Parameters
- $request
- The request object.
- $response
- The response object.
Throws
|
public
boolean
|
#
hasPermission( string|array $perm )
Test if the API key has been granted one or more permission.
Test if the API key has been granted one or more permission.
Parameters
- $perm
- The permission(s) to test for.
Returns
boolean true if the permission(s) have been granted; else false.
|
public
array
|
#
getPermissions( )
Get the permissions assigned to the API key.
Get the permissions assigned to the API key.
Returns
array Array of permissions assigned to the API Key.
|
Properties summary
protected
flDb
|
$db
|
|
protected
array
|
$serviceClass
Array of class names to use for specific services.
Array of class names to use for specific services.
|
|
protected
array
|
$perms
Permissions granted to the API key.
Permissions granted to the API key.
|
|