class Application extends Container implements Application

Constants

VERSION

The Flarum version.

Properties

protected string $basePath The base path for the Flarum installation.
protected string $publicPath The public path for the Flarum installation.
protected string $storagePath The custom storage path defined by the developer.
protected string $vendorPath A custom vendor path to find dependencies in non-standard environments.
protected bool $booted Indicates if the application has "booted".
protected array $bootingCallbacks The array of booting callbacks.
protected array $bootedCallbacks The array of booted callbacks.
protected array $serviceProviders All of the registered service providers.
protected array $loadedProviders The names of the loaded service providers.
protected array $deferredServices The deferred services and their providers.

Methods

__construct(string|null $basePath = null, string|null $publicPath = null)

Create a new Flarum application instance.

mixed
config(string $key, mixed $default = null)

No description

bool
inDebugMode()

Check if Flarum is in debug mode.

string
url(string $path = null)

Get the URL to the Flarum installation.

string
version()

Get the version number of the application.

registerBaseBindings()

Register the basic bindings into the container.

registerBaseServiceProviders()

Register all of the base service providers.

$this
setBasePath(string $basePath)

Set the base path for the application.

$this
setPublicPath(string $publicPath)

Set the public path for the application.

void
bindPathsInContainer()

Bind all of the application paths in the container.

string
basePath()

Get the base path of the Laravel installation.

string
publicPath()

Get the path to the public / web directory.

string
storagePath()

Get the path to the storage directory.

string
vendorPath()

Get the path to the vendor directory where dependencies are installed.

$this
useStoragePath(string $path)

Set the storage directory.

$this
useVendorPath(string $path)

Set the vendor directory.

string
environment()

Get or check the current application environment.

bool
runningInConsole()

Determine if we are running in the console.

bool
runningUnitTests()

Determine if we are running unit tests.

void
registerConfiguredProviders()

Register all of the configured providers.

ServiceProvider
register(ServiceProvider|string $provider, array $options = [], bool $force = false)

Register a service provider with the application.

ServiceProvider|null
getProvider(ServiceProvider|string $provider)

Get the registered service provider instance if it exists.

ServiceProvider
resolveProviderClass(string $provider)

Resolve a service provider instance from the class name.

void
markAsRegistered(ServiceProvider $provider)

Mark the given provider as registered.

loadDeferredProviders()

Load and boot all of the remaining deferred providers.

loadDeferredProvider(string $service)

Load the provider for a deferred service.

registerDeferredProvider(string $provider, string $service = null)

Register a deferred provider and service.

mixed
make(string $abstract, array $parameters = [])

Resolve the given type from the container.

bool
bound(string $abstract)

Determine if the given abstract type has been bound.

bool
isBooted()

Determine if the application has booted.

void
boot()

Boot the application's service providers.

mixed
bootProvider(ServiceProvider $provider)

Boot the given service provider.

void
booting(mixed $callback)

Register a new boot listener.

void
booted(mixed $callback)

Register a new "booted" listener.

void
fireAppCallbacks(array $callbacks)

Call the booting callbacks for the application.

string
getCachedCompilePath()

Get the path to the cached "compiled.php" file.

string
getCachedServicesPath()

Get the path to the cached services.json file.

bool
isDownForMaintenance()

Determine if the application is currently down for maintenance.

array
getLoadedProviders()

Get the service providers that have been loaded.

array
getDeferredServices()

Get the application's deferred services.

void
setDeferredServices(array $services)

Set the application's deferred services.

void
addDeferredServices(array $services)

Add an array of services to the application's deferred services.

bool
isDeferredService(string $service)

Determine if the given service is a deferred service.

registerCoreContainerAliases()

Register the core class aliases in the container.

flush()

Flush the container of all bindings and resolved instances.

string
getCachedPackagesPath()

Get the path to the cached packages.php file.

string
resourcePath()

No description

Details

__construct(string|null $basePath = null, string|null $publicPath = null)

Create a new Flarum application instance.

Parameters

string|null $basePath
string|null $publicPath

mixed config(string $key, mixed $default = null)

Parameters

string $key
mixed $default

Return Value

mixed

bool inDebugMode()

Check if Flarum is in debug mode.

Return Value

bool

string url(string $path = null)

Get the URL to the Flarum installation.

Parameters

string $path

Return Value

string

string version()

Get the version number of the application.

Return Value

string

protected registerBaseBindings()

Register the basic bindings into the container.

protected registerBaseServiceProviders()

Register all of the base service providers.

$this setBasePath(string $basePath)

Set the base path for the application.

Parameters

string $basePath

Return Value

$this

$this setPublicPath(string $publicPath)

Set the public path for the application.

Parameters

string $publicPath

Return Value

$this

protected void bindPathsInContainer()

Bind all of the application paths in the container.

Return Value

void

string basePath()

Get the base path of the Laravel installation.

Return Value

string

string publicPath()

Get the path to the public / web directory.

Return Value

string

string storagePath()

Get the path to the storage directory.

Return Value

string

string vendorPath()

Get the path to the vendor directory where dependencies are installed.

Return Value

string

$this useStoragePath(string $path)

Set the storage directory.

Parameters

string $path

Return Value

$this

$this useVendorPath(string $path)

Set the vendor directory.

Parameters

string $path

Return Value

$this

string environment()

Get or check the current application environment.

Return Value

string

bool runningInConsole()

Determine if we are running in the console.

Return Value

bool

bool runningUnitTests()

Determine if we are running unit tests.

Return Value

bool

void registerConfiguredProviders()

Register all of the configured providers.

Return Value

void

ServiceProvider register(ServiceProvider|string $provider, array $options = [], bool $force = false)

Register a service provider with the application.

Parameters

ServiceProvider|string $provider
array $options
bool $force

Return Value

ServiceProvider

ServiceProvider|null getProvider(ServiceProvider|string $provider)

Get the registered service provider instance if it exists.

Parameters

ServiceProvider|string $provider

Return Value

ServiceProvider|null

ServiceProvider resolveProviderClass(string $provider)

Resolve a service provider instance from the class name.

Parameters

string $provider

Return Value

ServiceProvider

protected void markAsRegistered(ServiceProvider $provider)

Mark the given provider as registered.

Parameters

ServiceProvider $provider

Return Value

void

loadDeferredProviders()

Load and boot all of the remaining deferred providers.

loadDeferredProvider(string $service)

Load the provider for a deferred service.

Parameters

string $service

registerDeferredProvider(string $provider, string $service = null)

Register a deferred provider and service.

Parameters

string $provider
string $service

mixed make(string $abstract, array $parameters = [])

Resolve the given type from the container.

(Overriding Container::make)

Parameters

string $abstract
array $parameters

Return Value

mixed

bool bound(string $abstract)

Determine if the given abstract type has been bound.

(Overriding Container::bound)

Parameters

string $abstract

Return Value

bool

bool isBooted()

Determine if the application has booted.

Return Value

bool

void boot()

Boot the application's service providers.

Return Value

void

protected mixed bootProvider(ServiceProvider $provider)

Boot the given service provider.

Parameters

ServiceProvider $provider

Return Value

mixed

void booting(mixed $callback)

Register a new boot listener.

Parameters

mixed $callback

Return Value

void

void booted(mixed $callback)

Register a new "booted" listener.

Parameters

mixed $callback

Return Value

void

protected void fireAppCallbacks(array $callbacks)

Call the booting callbacks for the application.

Parameters

array $callbacks

Return Value

void

string getCachedCompilePath()

Get the path to the cached "compiled.php" file.

Return Value

string

string getCachedServicesPath()

Get the path to the cached services.json file.

Return Value

string

bool isDownForMaintenance()

Determine if the application is currently down for maintenance.

Return Value

bool

array getLoadedProviders()

Get the service providers that have been loaded.

Return Value

array

array getDeferredServices()

Get the application's deferred services.

Return Value

array

void setDeferredServices(array $services)

Set the application's deferred services.

Parameters

array $services

Return Value

void

void addDeferredServices(array $services)

Add an array of services to the application's deferred services.

Parameters

array $services

Return Value

void

bool isDeferredService(string $service)

Determine if the given service is a deferred service.

Parameters

string $service

Return Value

bool

registerCoreContainerAliases()

Register the core class aliases in the container.

flush()

Flush the container of all bindings and resolved instances.

string getCachedPackagesPath()

Get the path to the cached packages.php file.

Return Value

string

string resourcePath()

Return Value

string