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
boolcreate()
Create and set the singleton from an Illuminate Request.
public
static create(Request $request) : self
Parameters
- $request : Request
Return values
selfget()
Get a named service.
public
get(string $name) : mixed
Parameters
- $name : string
getActionName()
Get the current action name.
public
getActionName() : string
Return values
stringgetConfigCache()
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
SfConfigCacheAdaptergetConfiguration()
Get the configuration (returns a minimal adapter).
public
getConfiguration() : SfConfigurationAdapter
Return values
SfConfigurationAdaptergetController()
Get the controller (minimal shim for sfAction redirect/forward).
public
getController() : SfControllerAdapter
Return values
SfControllerAdaptergetEventDispatcher()
Get the event dispatcher (minimal shim for sfComponent::initialize).
public
getEventDispatcher() : SfEventDispatcherAdapter
Return values
SfEventDispatcherAdaptergetI18n()
Get the i18n service (translation adapter).
public
getI18n() : SfI18nAdapter
Return values
SfI18nAdaptergetInstance()
Get the singleton instance.
public
static getInstance() : self
Return values
selfgetLogger()
Stub logger — logs to error_log in standalone mode.
public
getLogger() : SfLoggerAdapter
Return values
SfLoggerAdaptergetModuleName()
Get the current module name.
public
getModuleName() : string
Return values
stringgetRequest()
public
getRequest() : SfWebRequestAdapter
Return values
SfWebRequestAdaptergetResponse()
public
getResponse() : SfResponseAdapter
Return values
SfResponseAdaptergetRouting()
Get the routing instance (minimal shim for url generation).
public
getRouting() : SfRoutingAdapter
Return values
SfRoutingAdaptergetUser()
public
getUser() : SfUserAdapter
Return values
SfUserAdapterhas()
Check if a named service is registered.
public
has(string $name) : bool
Parameters
- $name : string
Return values
boolhasInstance()
Check if the context has been initialized.
public
static hasInstance() : bool
Return values
boolreset()
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