ApiRouteRegistration
in package
implements
Bootstrapper
Class ApiRouteRegistration
Interfaces, Classes and Traits
- Bootstrapper
- Interface Bootstrapper
Table of Contents
- CACHE_KEY = 'api_routes'
- CACHE_NAMESPACE = 'application_routes'
- boot() : void
- Application bootstrapping.
- getCacheFactory() : CacheFactory
- getEnvironment() : Environment
- getRouteCollector() : RouteCollector
- Returns a slim application instance.
- getRoutes() : array<string|int, mixed>
- Returns a list of absolute file paths for route files.
- registerBaseAction() : void
- registerRoutes() : void
- Registers the route files.
Constants
CACHE_KEY
private
mixed
CACHE_KEY
= 'api_routes'
CACHE_NAMESPACE
private
mixed
CACHE_NAMESPACE
= 'application_routes'
Methods
boot()
Application bootstrapping.
public
boot(Application $application) : void
Parameters
- $application : Application
Tags
Return values
void —getCacheFactory()
private
getCacheFactory(Application $application) : CacheFactory
Parameters
- $application : Application
Return values
CacheFactory —getEnvironment()
private
getEnvironment(Application $application) : Environment
Parameters
- $application : Application
Return values
Environment —getRouteCollector()
Returns a slim application instance.
private
getRouteCollector(Application $application) : RouteCollector
Parameters
- $application : Application
Return values
RouteCollector —getRoutes()
Returns a list of absolute file paths for route files.
private
getRoutes() : array<string|int, mixed>
Route files are determined by their location and filename. Files called routes.php in
Modules and Submodules of the Gambio\Api are loaded from the system.
Return values
array<string|int, mixed> —registerBaseAction()
private
registerBaseAction(Application $application) : void
Parameters
- $application : Application
Return values
void —registerRoutes()
Registers the route files.
private
registerRoutes(array<string|int, mixed> $routes, RouteCollector $routeCollector) : void
It must be ensured that each element in $routes is a valid filepath, which is done
by using array_filter($data, 'is_file') in ::getRoutes.
Parameters
- $routes : array<string|int, mixed>
- $routeCollector : RouteCollector