Application
- Full name:
\Codefy\Framework\Application
- Parent class:
Container
- This class is marked as final and can't be subclassed
- This class is a Final class
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
APP_VERSION | public | '3.0.0-rc.2' | |
MIN_PHP_VERSION | public | '8.4' | |
DS | public | \DIRECTORY_SEPARATOR |
Properties
APP
The current globally available Application (if any).
- This property is static.
charset
language
locale
controllerNamespace
ROOT_PATH
- This property is static.
encryptedEnv
- This property is static.
basePath
appPath
serviceProviders
serviceProvidersRegistered
baseMiddlewares
booted
hasBeenBootstrapped
bootingCallbacks
bootedCallbacks
registeredCallbacks
param
request
response
assets
mailer
session
flash
event
httpCookie
localStorage
configContainer
pipeline
hook
string
array
router
path
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$params | array |
Throws:
registerBaseBindings
inferBasePath
Infer the application's base directory from the environment and server.
- This method is static.
getDbConnection
Throws:
getDb
Throws:
version
Return the version of the Application's Framework.
singleton
Ensure a value or object will remain globally unique.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | The value or object name |
$value | callable | The closure that defines the object |
registerDefaultServiceProviders
Throws:
bootstrapWith
Parameters:
Parameter | Type | Description |
---|---|---|
$bootstrappers | array |
getContainer
setBooted
Parameters:
Parameter | Type | Description |
---|---|---|
$bool | bool |
boot
Throws:
forceRegisterServiceProvider
Force register a service provider with the application.
public forceRegisterServiceProvider(string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $provider): \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable
Parameters:
Parameter | Type | Description |
---|---|---|
$provider | string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable |
Throws:
registerConfiguredServiceProviders
Register all configured providers.
Throws:
registerServiceProvider
Register a Service Provider to the application.
public registerServiceProvider(string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $serviceProvider, bool $force = false): \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable|string
Parameters:
Parameter | Type | Description |
---|---|---|
$serviceProvider | string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable | |
$force | bool |
Throws:
getRegisteredServiceProvider
Get the registered service provider instance if it exists.
public getRegisteredServiceProvider(\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable|string $provider): \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable|null
Parameters:
Parameter | Type | Description |
---|---|---|
$provider | \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable|string |
forgetServiceProvider
Forget the ServiceProvider from the application.
public forgetServiceProvider(string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $serviceProvider): void
Parameters:
Parameter | Type | Description |
---|---|---|
$serviceProvider | string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable |
resolveServiceProvider
Resolve a service provider instance from the class name.
public resolveServiceProvider(string $provider): \Qubus\Injector\ServiceProvider\BaseServiceProvider
Parameters:
Parameter | Type | Description |
---|---|---|
$provider | string |
getRegisteredProviders
Get the service providers that have been registered.
providerIsRegistered
Determine if the given service provider is registered.
public providerIsRegistered(string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $provider): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$provider | string|\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable |
bootServiceProvider
Boot the given service provider.
protected bootServiceProvider(\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $provider): void
Parameters:
Parameter | Type | Description |
---|---|---|
$provider | \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable |
Throws:
booting
Register a new boot listener.
Parameters:
Parameter | Type | Description |
---|---|---|
$callback | callable |
booted
Register a new "booted" listener.
Parameters:
Parameter | Type | Description |
---|---|---|
$callback | callable |
fireAppCallbacks
Call the booting callbacks for the application.
Parameters:
Parameter | Type | Description |
---|---|---|
$callbacks | callable[] |
markServiceProviderAsRegistered
Mark the particular ServiceProvider as having been registered.
protected markServiceProviderAsRegistered(\Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable $serviceProvider): void
Parameters:
Parameter | Type | Description |
---|---|---|
$serviceProvider | \Qubus\Injector\ServiceProvider\Serviceable|\Qubus\Injector\ServiceProvider\Bootable |
hasBeenBootstrapped
Determine if the application has been bootstrapped before.
withBasePath
Set the Application's base directory.
Parameters:
Parameter | Type | Description |
---|---|---|
$basePath | string |
bindPathsToContainer
withAppPath
Set the Application's "app" directory.
Parameters:
Parameter | Type | Description |
---|---|---|
$appPath | string |
path
Get the path to the application's "app" directory.
basePath
Get the Application's base directory.
bootStrapPath
Get the path to the application's "bootstrap" directory.
getBootstrapProvidersPath
Get the path to the service provider list in the bootstrap directory.
configPath
Get the path to the application's "config" directory.
databasePath
Get the path to the application's "database" directory.
localePath
Get the path to the application's "locale" directory.
publicPath
Get the path to the application's "public" directory.
storagePath
Get the path to the application's "storage" directory.
resourcePath
Get the path to the application's "resources" directory.
viewPath
Get the path to the application's "view" directory.
withLocale
Parameters:
Parameter | Type | Description |
---|---|---|
$locale | string |
getLocale
withControllerNamespace
Parameters:
Parameter | Type | Description |
---|---|---|
$namespace | string |
withBaseMiddlewares
Parameters:
Parameter | Type | Description |
---|---|---|
$middlewares | array |
getBaseMiddlewares
Throws:
isRunningInConsole
hasDebugModeEnabled
Determine if the application is running with debug mode enabled.
Throws:
registered
Register a new callable function.
Parameters:
Parameter | Type | Description |
---|---|---|
$callback | callable |
coreAliases
handle
public handle(\Psr\Http\Message\ServerRequestInterface $request): \Psr\Http\Message\ResponseInterface
Parameters:
Parameter | Type | Description |
---|---|---|
$request | \Psr\Http\Message\ServerRequestInterface |
Throws:
handleRequest
Parameters:
Parameter | Type | Description |
---|---|---|
$request | ?\Psr\Http\Message\ServerRequestInterface |
loadEnvironment
Load environment file(s).
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$basePath | string |
Throws:
__get
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed |
__isset
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed |
__set
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed | |
$value | mixed |
__unset
Parameters:
Parameter | Type | Description |
---|---|---|
$name | mixed |
__destruct
isProduction
Determine if the application is in production.
isDevelopment
Determine if the application is in development.
create
Create a new CodefyPHP application instance.
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$config | array |
Throws:
getInstance
Get the globally available instance of the container.
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$path | ?string |
Throws:
Inherited methods
getLogger
FileLogger
- This method is static.
Throws:
getSmtpLogger
FileLogger with SMTP support.
- This method is static.
Throws:
Automatically generated on 2025-10-13