Heratio Framework API Reference

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:

  1. Register sfConfig shim (if Symfony not loaded)
  2. Load database config → boot Capsule
  3. Load settings from DB → populate ConfigService
  4. Load app.yml settings (CSP, etc.)
  5. Create Router with container
  6. Register health/status routes
  7. Collect routes from enabled plugins
  8. 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
Container

getRootDir()

Get the AtoM root directory.

public getRootDir() : string
Return values
string

getRouter()

Get the Laravel Router instance.

public getRouter() : Router
Return values
Router

handle()

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
Response

isEnabled()

Check whether Heratio is enabled.

public isEnabled() : bool

Fail-closed: Heratio must be explicitly enabled via:

  1. Environment variable HERATIO_ENABLED=1 (or true/yes/on)
  2. 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
bool

isStandaloneMode()

Check whether the kernel booted in standalone mode (no Symfony/Propel).

public isStandaloneMode() : bool
Return values
bool

pushMiddleware()

Add middleware to the stack.

public pushMiddleware(string $middlewareClass) : void
Parameters
$middlewareClass : string

        
On this page

Search results