ApplicationContext
final class ApplicationContext (View source)
Carries the immutable environment, path, and debug boundaries resolved for one application bootstrap.
Methods
Captures the resolved runtime values shared by HTTP and CLI infrastructure services.
Returns the normalized application environment used for runtime policy decisions.
Reports whether development diagnostics are enabled for this application.
Reports whether development diagnostics are enabled for this application.
Returns the absolute application root established during bootstrap.
Resolves an absolute path or an application-root-relative path without asserting containment.
Resolves a path below the conventional application source directory.
Resolves a path below the application configuration directory.
Resolves a path below application storage.
Resolves a path below the configured public web root.
Preserves an absolute path or resolves a relative path below application storage.
Preserves an absolute path or resolves a relative path below private writable storage.
Preserves an absolute path or resolves a relative path below writable log storage.
Preserves an absolute path or composes a relative path below writable session storage.
Resolves an upload path using the public upload storage convention.
Preserves an absolute path or resolves a relative path below the public uploads directory.
Preserves an absolute path or resolves a relative path below application cache storage.
Returns a portable forward-slash path relative to the public root for an upload location.
Reports whether production runtime behavior is active.
Reports whether development runtime behavior is active.
Reports whether testing runtime behavior is active.
Details
__construct
Captures the resolved runtime values shared by HTTP and CLI infrastructure services.
environment
Environment
environment()
Returns the normalized application environment used for runtime policy decisions.
paths
Path
paths()
Returns the immutable path resolver rooted at the configured application directory.
debug
bool
debug()
Reports whether development diagnostics are enabled for this application.
isDebug
bool
isDebug()
Reports whether development diagnostics are enabled for this application.
basePath
string
basePath()
Returns the absolute application root established during bootstrap.
path
string
path(string $path = '')
Resolves an absolute path or an application-root-relative path without asserting containment.
appPath
string
appPath(string $path = '')
Resolves a path below the conventional application source directory.
configPath
string
configPath(string $path = '')
Resolves a path below the application configuration directory.
storagePath
string
storagePath(string $path = '')
Resolves a path below application storage.
publicPath
string
publicPath(string $path = '')
Resolves a path below the configured public web root.
resolveStoragePath
string
resolveStoragePath(string $path = '')
Preserves an absolute path or resolves a relative path below application storage.
This method performs path composition only; consumers that persist untrusted data must apply their own containment and symbolic-link policy.
resolveWritablePath
string
resolveWritablePath(string $path = '')
Preserves an absolute path or resolves a relative path below private writable storage.
resolveLogPath
string
resolveLogPath(string $path = '')
Preserves an absolute path or resolves a relative path below writable log storage.
resolveSessionPath
string
resolveSessionPath(string $path = 'sessions')
Preserves an absolute path or composes a relative path below writable session storage.
File-backed session construction subsequently enforces traversal, symlink, ownership, permission, and public-webroot boundaries; this general context helper performs path composition only.
resolveUploadPath
string
resolveUploadPath(string $path = '')
Resolves an upload path using the public upload storage convention.
uploadPath
string
uploadPath(string $path = '')
Preserves an absolute path or resolves a relative path below the public uploads directory.
resolveCachePath
string
resolveCachePath(string $path = '')
Preserves an absolute path or resolves a relative path below application cache storage.
uploadRelativePath
string
uploadRelativePath(string $path = '')
Returns a portable forward-slash path relative to the public root for an upload location.
isProduction
bool
isProduction()
Reports whether production runtime behavior is active.
isDevelopment
bool
isDevelopment()
Reports whether development runtime behavior is active.
isTesting
bool
isTesting()
Reports whether testing runtime behavior is active.