Heratio Framework API Reference

SfContextAdapter
in package

Standalone sfContext implementation backed by Laravel services.

Provides getInstance(), getRequest(), getResponse(), getUser() for code that depends on sfContext when Symfony isn't loaded. Only activated in standalone mode (heratio.php).

Table of Contents

Methods

__construct()  : mixed
__get()  : mixed
Magic property access for sfContext compatibility.
__isset()  : bool
Magic property check for sfContext compatibility.
create()  : self
Create and set the singleton from an Illuminate Request.
get()  : mixed
Get a named service.
getActionName()  : string
Get the current action name.
getConfigCache()  : SfConfigCacheAdapter
Get the config cache (minimal shim for sfAction::initialize).
getConfiguration()  : SfConfigurationAdapter
Get the configuration (returns a minimal adapter).
getController()  : SfControllerAdapter
Get the controller (minimal shim for sfAction redirect/forward).
getEventDispatcher()  : SfEventDispatcherAdapter
Get the event dispatcher (minimal shim for sfComponent::initialize).
getI18n()  : SfI18nAdapter
Get the i18n service (translation adapter).
getInstance()  : self
Get the singleton instance.
getLogger()  : SfLoggerAdapter
Stub logger — logs to error_log in standalone mode.
getModuleName()  : string
Get the current module name.
getRequest()  : SfWebRequestAdapter
getResponse()  : SfResponseAdapter
getRouting()  : SfRoutingAdapter
Get the routing instance (minimal shim for url generation).
getUser()  : SfUserAdapter
has()  : bool
Check if a named service is registered.
hasInstance()  : bool
Check if the context has been initialized.
reset()  : void
Reset the singleton (for testing).
set()  : void
Register a named service.
setActionName()  : void
Set the current action name.
setModuleName()  : void
Set the current module name.

Methods

__construct()

public __construct(Request $illuminateRequest) : mixed
Parameters
$illuminateRequest : Request

__get()

Magic property access for sfContext compatibility.

public __get(string $name) : mixed

Symfony's sfContext allows $context->user, $context->request, etc. via __get(). sfAction code uses $this->context->user directly.

Parameters
$name : string

__isset()

Magic property check for sfContext compatibility.

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

create()

Create and set the singleton from an Illuminate Request.

public static create(Request $request) : self
Parameters
$request : Request
Return values
self

get()

Get a named service.

public get(string $name) : mixed
Parameters
$name : string

getActionName()

Get the current action name.

public getActionName() : string
Return values
string

getConfigCache()

Get the config cache (minimal shim for sfAction::initialize).

public getConfigCache() : SfConfigCacheAdapter

sfAction::initialize() loads security.yml via $context->getConfigCache(). In standalone mode, we skip security config loading.

Return values
SfConfigCacheAdapter

getInstance()

Get the singleton instance.

public static getInstance() : self
Return values
self

getModuleName()

Get the current module name.

public getModuleName() : string
Return values
string

has()

Check if a named service is registered.

public has(string $name) : bool
Parameters
$name : string
Return values
bool

hasInstance()

Check if the context has been initialized.

public static hasInstance() : bool
Return values
bool

reset()

Reset the singleton (for testing).

public static reset() : void

set()

Register a named service.

public set(string $name, mixed $service) : void
Parameters
$name : string
$service : mixed

setActionName()

Set the current action name.

public setActionName(string $name) : void
Parameters
$name : string

setModuleName()

Set the current module name.

public setModuleName(string $name) : void
Parameters
$name : string

        
On this page

Search results