Kernel
in package
Heratio Application Kernel — standalone Laravel HTTP kernel.
Boots a minimal Laravel stack (container + router + middleware pipeline) that can handle requests independently of Symfony. Designed for dual-stack operation: Nginx routes specific paths here while everything else goes through Symfony's index.php.
Boot sequence:
- Register sfConfig shim (if Symfony not loaded)
- Load database config → boot Capsule
- Load settings from DB → populate ConfigService
- Load app.yml settings (CSP, etc.)
- Create Router with container
- Register health/status routes
- Collect routes from enabled plugins
- Handle(Request) → Response
Table of Contents
Methods
- __construct() : mixed
- boot() : void
- Boot the application kernel.
- getContainer() : Container
- Get the service container.
- getRootDir() : string
- Get the AtoM root directory.
- getRouter() : Router
- Get the Laravel Router instance.
- handle() : Response
- Handle an incoming HTTP request.
- isEnabled() : bool
- Check whether Heratio is enabled.
- isStandaloneMode() : bool
- Check whether the kernel booted in standalone mode (no Symfony/Propel).
- pushMiddleware() : void
- Add middleware to the stack.
Methods
__construct()
public
__construct([string|null $rootDir = null ]) : mixed
Parameters
- $rootDir : string|null = null
boot()
Boot the application kernel.
public
boot() : void
Initializes the container, database, config, router, and routes. Safe to call multiple times — subsequent calls are no-ops.
getContainer()
Get the service container.
public
getContainer() : Container
Return values
ContainergetRootDir()
Get the AtoM root directory.
public
getRootDir() : string
Return values
stringgetRouter()
Get the Laravel Router instance.
public
getRouter() : Router
Return values
Routerhandle()
Handle an incoming HTTP request.
public
handle(Request $request) : Response
If Heratio is disabled (kill-switch), returns a 404 response without touching session or database.
Parameters
- $request : Request
Return values
ResponseisEnabled()
Check whether Heratio is enabled.
public
isEnabled() : bool
Fail-closed: Heratio must be explicitly enabled via:
- Environment variable HERATIO_ENABLED=1 (or true/yes/on)
- Flag file {rootDir}/.heratio_enabled
If neither is set, Heratio is disabled and handle() returns 404. This allows instant disable without code changes — just remove the flag file or set HERATIO_ENABLED=0.
Return values
boolisStandaloneMode()
Check whether the kernel booted in standalone mode (no Symfony/Propel).
public
isStandaloneMode() : bool
Return values
boolpushMiddleware()
Add middleware to the stack.
public
pushMiddleware(string $middlewareClass) : void
Parameters
- $middlewareClass : string