Application
interface Application implements Container
Methods
Assign a set of tags to a given binding.
Register a binding with the container.
Bind a callback to resolve with Container::call.
Register a binding if it hasn't already been registered.
Register a shared binding in the container.
Register a shared binding if it hasn't already been registered.
Register a scoped binding in the container.
Register a scoped binding if it hasn't already been registered.
Register an existing instance as shared in the container.
Remove a resolved instance from the instance cache.
Add a contextual binding to the container.
Get a closure to resolve the given type from the container.
Resolve the given type from the container.
Instantiate a concrete instance with the given parameter overrides.
Call the given Closure / class@method and inject its dependencies.
Determine if the given abstract type has been resolved.
Register a new rebinding callback for an abstract type.
Register a new before resolving callback.
Register a new resolving callback.
Register a new after resolving callback.
Get the version number of the application.
Run the given array of bootstrap classes.
Determine if the application has been bootstrapped before.
Set the base path for the application.
Get the base path of the Hypervel installation.
Get the path to the bootstrap directory.
Get the path to the application "app" directory.
Get the path to the application configuration files.
Get the path to the database directory.
Get the path to the language files.
Get the path to the public directory.
Get the path to the resources directory.
Get the path to the views directory.
Get the path to the storage directory.
Determine if the application configuration is cached.
Get the path to the configuration cache file.
Join the given paths together.
Get or check the current application environment.
Determine if the application is in the local environment.
Determine if the application is in the production environment.
Set the callback to resolve the application's environment.
Get the path to the environment file directory.
Set the directory for the environment file.
Set the environment file to be loaded during bootstrapping.
Get the environment file the application is using.
Get the fully qualified path to the environment file.
Determine if the application is running in the console.
Determine if the application is running any of the given console commands.
Determine if the application is running unit tests.
Determine if the application is running with debug mode enabled.
Get an instance of the maintenance mode manager implementation.
Determine if the application is currently down for maintenance.
Register all of the configured providers.
Register a service provider with the application.
Get the registered service provider instances if any exist.
Resolve a service provider instance from the class name.
Determine if the application has booted.
Boot the application's service providers.
Register a new boot listener.
Register a new "booted" listener.
Throw an HttpException with the given data.
Get the service providers that have been loaded.
Determine if the given service provider is loaded.
Get the current application locale.
Determine if the application locale is the given locale.
Get the current application locale.
Get the current application fallback locale.
Set the current application locale.
Determine if the application routes are cached.
Get the path to the routes cache file.
Determine if the application events are cached.
Get the path to the events cache file.
Get the path to the cached packages.php file.
Determine if the framework's base configuration should be merged.
Determine if middleware has been disabled for the application.
Register a terminating callback with the application.
Terminate the application.
Get the application namespace.
Details
in
Container at line 21
mixed
get(string $id)
No description
in
Container at line 26
bool
bound(string $abstract)
Determine if the given abstract type has been bound.
in
Container at line 33
void
alias(string $abstract, string $alias)
Alias a type to a different name.
in
Container at line 38
void
tag(array|string $abstracts, array|string $tags)
Assign a set of tags to a given binding.
in
Container at line 43
iterable
tagged(string $tag)
Resolve all of the bindings for a given tag.
in
Container at line 48
void
bind(Closure|string $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding with the container.
in
Container at line 53
void
bindMethod(array|string $method, Closure $callback)
Bind a callback to resolve with Container::call.
in
Container at line 58
void
bindIf(Closure|string $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding if it hasn't already been registered.
in
Container at line 63
void
singleton(Closure|string $abstract, Closure|string|null $concrete = null)
Register a shared binding in the container.
in
Container at line 68
void
singletonIf(Closure|string $abstract, Closure|string|null $concrete = null)
Register a shared binding if it hasn't already been registered.
in
Container at line 73
void
scoped(Closure|string $abstract, Closure|string|null $concrete = null)
Register a scoped binding in the container.
in
Container at line 78
void
scopedIf(Closure|string $abstract, Closure|string|null $concrete = null)
Register a scoped binding if it hasn't already been registered.
in
Container at line 85
void
extend(string $abstract, Closure $closure)
"Extend" an abstract type in the container.
in
Container at line 95
mixed
instance(string $abstract, mixed $instance)
Register an existing instance as shared in the container.
in
Container at line 100
void
forgetInstance(string $abstract)
Remove a resolved instance from the instance cache.
in
Container at line 105
void
addContextualBinding(string $concrete, string $abstract, mixed $implementation)
Add a contextual binding to the container.
in
Container at line 110
ContextualBindingBuilder
when(string|array $concrete)
Define a contextual binding.
in
Container at line 120
Closure
factory(string $abstract)
Get a closure to resolve the given type from the container.
in
Container at line 125
void
flush()
Flush the container of all bindings and resolved instances.
in
Container at line 137
mixed
make(string $abstract, array $parameters = [])
Resolve the given type from the container.
in
Container at line 147
mixed
build(Closure|string $concrete)
Instantiate a concrete instance of the given type.
Unlike make(), this always creates a fresh instance — it bypasses bindings, aliases, and singleton/auto-singleton caching.
in
Container at line 157
mixed
buildWith(Closure|string $concrete, array $parameters = [])
Instantiate a concrete instance with the given parameter overrides.
Unlike make(), this always creates a fresh instance — it bypasses bindings, aliases, and singleton/auto-singleton caching.
in
Container at line 162
mixed
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
Call the given Closure / class@method and inject its dependencies.
in
Container at line 167
bool
resolved(string $abstract)
Determine if the given abstract type has been resolved.
in
Container at line 172
mixed
rebinding(string $abstract, Closure $callback)
Register a new rebinding callback for an abstract type.
in
Container at line 177
void
beforeResolving(Closure|string $abstract, Closure|null $callback = null)
Register a new before resolving callback.
in
Container at line 182
void
resolving(Closure|string $abstract, Closure|null $callback = null)
Register a new resolving callback.
in
Container at line 187
void
afterResolving(Closure|string $abstract, Closure|null $callback = null)
Register a new after resolving callback.
at line 19
string
version()
Get the version number of the application.
at line 24
void
bootstrapWith(array $bootstrappers)
Run the given array of bootstrap classes.
at line 29
bool
hasBeenBootstrapped()
Determine if the application has been bootstrapped before.
at line 36
Application
setBasePath(string $basePath)
Set the base path for the application.
at line 41
string
basePath(string $path = '')
Get the base path of the Hypervel installation.
at line 46
string
bootstrapPath(string $path = '')
Get the path to the bootstrap directory.
at line 51
string
path(string $path = '')
Get the path to the application "app" directory.
at line 56
string
configPath(string $path = '')
Get the path to the application configuration files.
at line 61
string
databasePath(string $path = '')
Get the path to the database directory.
at line 66
string
langPath(string $path = '')
Get the path to the language files.
at line 71
string
publicPath(string $path = '')
Get the path to the public directory.
at line 76
string
resourcePath(string $path = '')
Get the path to the resources directory.
at line 83
string
viewPath(string $path = '')
Get the path to the views directory.
This method returns the first configured path in the array of view paths.
at line 88
string
storagePath(string $path = '')
Get the path to the storage directory.
at line 93
bool
configurationIsCached()
Determine if the application configuration is cached.
at line 98
string
getCachedConfigPath()
Get the path to the configuration cache file.
at line 103
string
joinPaths(string|null $basePath, string $path = '')
Join the given paths together.
at line 108
bool|string
environment(array|string ...$environments)
Get or check the current application environment.
at line 113
bool
isLocal()
Determine if the application is in the local environment.
at line 118
bool
isProduction()
Determine if the application is in the production environment.
at line 123
string
detectEnvironment(Closure $callback)
Detect the application's current environment.
at line 128
void
resolveEnvironmentUsing(callable|null $callback)
Set the callback to resolve the application's environment.
at line 133
string|null
environmentPath()
Get the path to the environment file directory.
at line 140
Application
useEnvironmentPath(string $path)
Set the directory for the environment file.
at line 147
Application
loadEnvironmentFrom(string $file)
Set the environment file to be loaded during bootstrapping.
at line 152
string
environmentFile()
Get the environment file the application is using.
at line 157
string
environmentFilePath()
Get the fully qualified path to the environment file.
at line 165
bool
runningInConsole()
Determine if the application is running in the console.
In Swoole, PHP_SAPI is always 'cli', so the value is determined by explicit framework signals rather than SAPI detection.
at line 170
bool
runningConsoleCommand(string|array ...$commands)
Determine if the application is running any of the given console commands.
at line 175
bool
runningUnitTests()
Determine if the application is running unit tests.
at line 180
bool
hasDebugModeEnabled()
Determine if the application is running with debug mode enabled.
at line 185
MaintenanceMode
maintenanceMode()
Get an instance of the maintenance mode manager implementation.
at line 190
bool
isDownForMaintenance()
Determine if the application is currently down for maintenance.
at line 195
void
registerConfiguredProviders()
Register all of the configured providers.
at line 200
ServiceProvider
register(ServiceProvider|string $provider, bool $force = false)
Register a service provider with the application.
at line 205
array
getProviders(ServiceProvider|string $provider)
Get the registered service provider instances if any exist.
at line 210
ServiceProvider
resolveProvider(string $provider)
Resolve a service provider instance from the class name.
at line 215
bool
isBooted()
Determine if the application has booted.
at line 220
void
boot()
Boot the application's service providers.
at line 225
void
booting(callable $callback)
Register a new boot listener.
at line 230
void
booted(callable $callback)
Register a new "booted" listener.
at line 238
never
abort(int $code, string $message = '', array $headers = [])
Throw an HttpException with the given data.
at line 245
array
getLoadedProviders()
Get the service providers that have been loaded.
at line 250
bool
providerIsLoaded(string $provider)
Determine if the given service provider is loaded.
at line 255
string
getLocale()
Get the current application locale.
at line 260
bool
isLocale(string $locale)
Determine if the application locale is the given locale.
at line 265
string
currentLocale()
Get the current application locale.
at line 270
string
getFallbackLocale()
Get the current application fallback locale.
at line 275
void
setLocale(string $locale)
Set the current application locale.
at line 280
bool
routesAreCached()
Determine if the application routes are cached.
at line 285
string
getCachedRoutesPath()
Get the path to the routes cache file.
at line 290
bool
eventsAreCached()
Determine if the application events are cached.
at line 295
string
getCachedEventsPath()
Get the path to the events cache file.
at line 300
string
getCachedPackagesPath()
Get the path to the cached packages.php file.
at line 305
bool
shouldMergeFrameworkConfiguration()
Determine if the framework's base configuration should be merged.
at line 310
bool
shouldSkipMiddleware()
Determine if middleware has been disabled for the application.
at line 317
Application
terminating(callable|string $callback)
Register a terminating callback with the application.
at line 322
void
terminate()
Terminate the application.
at line 329
string
getNamespace()
Get the application namespace.