class Application extends Container implements Application

Constants

VERSION

<p>The Flarum version.</p>

Properties

protected string $basePath <p>The base path for the Flarum installation.</p>
protected bool $booted <p>Indicates if the application has &quot;booted&quot;.</p>
protected array $bootingCallbacks <p>The array of booting callbacks.</p>
protected array $bootedCallbacks <p>The array of booted callbacks.</p>
protected array $serviceProviders <p>All of the registered service providers.</p>
protected array $loadedProviders <p>The names of the loaded service providers.</p>
protected array $deferredServices <p>The deferred services and their providers.</p>
protected string $storagePath <p>The custom storage path defined by the developer.</p>

Methods

__construct(string|null $basePath = null)

<p>Create a new Flarum application instance.</p>

bool
isInstalled()

<p>Determine if Flarum has been installed.</p>

isUpToDate()

No description

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

No description

bool
inDebugMode()

<p>Check if Flarum is in debug mode.</p>

string
url(string $path = null)

<p>Get the URL to the Flarum installation.</p>

string
version()

<p>Get the version number of the application.</p>

registerBaseBindings()

<p>Register the basic bindings into the container.</p>

registerBaseServiceProviders()

<p>Register all of the base service providers.</p>

$this
setBasePath(string $basePath)

<p>Set the base path for the application.</p>

void
bindPathsInContainer()

<p>Bind all of the application paths in the container.</p>

string
basePath()

<p>Get the base path of the Laravel installation.</p>

string
publicPath()

<p>Get the path to the public / web directory.</p>

string
storagePath()

<p>Get the path to the storage directory.</p>

$this
useStoragePath(string $path)

<p>Set the storage directory.</p>

string
environment()

<p>Get or check the current application environment.</p>

bool
runningInConsole()

<p>Determine if we are running in the console.</p>

bool
runningUnitTests()

<p>Determine if we are running unit tests.</p>

void
registerConfiguredProviders()

<p>Register all of the configured providers.</p>

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

<p>Register a service provider with the application.</p>

ServiceProvider|null
getProvider(ServiceProvider|string $provider)

<p>Get the registered service provider instance if it exists.</p>

ServiceProvider
resolveProviderClass(string $provider)

<p>Resolve a service provider instance from the class name.</p>

void
markAsRegistered(ServiceProvider $provider)

<p>Mark the given provider as registered.</p>

loadDeferredProviders()

<p>Load and boot all of the remaining deferred providers.</p>

loadDeferredProvider(string $service)

<p>Load the provider for a deferred service.</p>

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

<p>Register a deferred provider and service.</p>

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

<p>Resolve the given type from the container.</p>

bool
bound(string $abstract)

<p>Determine if the given abstract type has been bound.</p>

bool
isBooted()

<p>Determine if the application has booted.</p>

void
boot()

<p>Boot the application's service providers.</p>

mixed
bootProvider(ServiceProvider $provider)

<p>Boot the given service provider.</p>

void
booting(mixed $callback)

<p>Register a new boot listener.</p>

void
booted(mixed $callback)

<p>Register a new &quot;booted&quot; listener.</p>

void
fireAppCallbacks(array $callbacks)

<p>Call the booting callbacks for the application.</p>

string
getCachedCompilePath()

<p>Get the path to the cached &quot;compiled.php&quot; file.</p>

string
getCachedServicesPath()

<p>Get the path to the cached services.json file.</p>

bool
isDownForMaintenance()

<p>Determine if the application is currently down for maintenance.</p>

array
getLoadedProviders()

<p>Get the service providers that have been loaded.</p>

array
getDeferredServices()

<p>Get the application's deferred services.</p>

void
setDeferredServices(array $services)

<p>Set the application's deferred services.</p>

void
addDeferredServices(array $services)

<p>Add an array of services to the application's deferred services.</p>

bool
isDeferredService(string $service)

<p>Determine if the given service is a deferred service.</p>

registerCoreContainerAliases()

<p>Register the core class aliases in the container.</p>

flush()

<p>Flush the container of all bindings and resolved instances.</p>

Details

__construct(string|null $basePath = null)

<p>Create a new Flarum application instance.</p>

Parameters

string|null $basePath

bool isInstalled()

<p>Determine if Flarum has been installed.</p>

Return Value

bool

isUpToDate()

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

Parameters

string $key
mixed $default

Return Value

mixed

bool inDebugMode()

<p>Check if Flarum is in debug mode.</p>

Return Value

bool

string url(string $path = null)

<p>Get the URL to the Flarum installation.</p>

Parameters

string $path

Return Value

string

string version()

<p>Get the version number of the application.</p>

Return Value

string

protected registerBaseBindings()

<p>Register the basic bindings into the container.</p>

protected registerBaseServiceProviders()

<p>Register all of the base service providers.</p>

$this setBasePath(string $basePath)

<p>Set the base path for the application.</p>

Parameters

string $basePath

Return Value

$this

protected void bindPathsInContainer()

<p>Bind all of the application paths in the container.</p>

Return Value

void

string basePath()

<p>Get the base path of the Laravel installation.</p>

Return Value

string

string publicPath()

<p>Get the path to the public / web directory.</p>

Return Value

string

string storagePath()

<p>Get the path to the storage directory.</p>

Return Value

string

$this useStoragePath(string $path)

<p>Set the storage directory.</p>

Parameters

string $path

Return Value

$this

string environment()

<p>Get or check the current application environment.</p>

Return Value

string

bool runningInConsole()

<p>Determine if we are running in the console.</p>

Return Value

bool

bool runningUnitTests()

<p>Determine if we are running unit tests.</p>

Return Value

bool

void registerConfiguredProviders()

<p>Register all of the configured providers.</p>

Return Value

void

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

<p>Register a service provider with the application.</p>

Parameters

ServiceProvider|string $provider
array $options
bool $force

Return Value

ServiceProvider

ServiceProvider|null getProvider(ServiceProvider|string $provider)

<p>Get the registered service provider instance if it exists.</p>

Parameters

ServiceProvider|string $provider

Return Value

ServiceProvider|null

ServiceProvider resolveProviderClass(string $provider)

<p>Resolve a service provider instance from the class name.</p>

Parameters

string $provider

Return Value

ServiceProvider

protected void markAsRegistered(ServiceProvider $provider)

<p>Mark the given provider as registered.</p>

Parameters

ServiceProvider $provider

Return Value

void

loadDeferredProviders()

<p>Load and boot all of the remaining deferred providers.</p>

loadDeferredProvider(string $service)

<p>Load the provider for a deferred service.</p>

Parameters

string $service

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

<p>Register a deferred provider and service.</p>

Parameters

string $provider
string $service

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

<p>Resolve the given type from the container.</p>

<p>(Overriding Container::make)</p>

Parameters

string $abstract
array $parameters

Return Value

mixed

bool bound(string $abstract)

<p>Determine if the given abstract type has been bound.</p>

<p>(Overriding Container::bound)</p>

Parameters

string $abstract

Return Value

bool

bool isBooted()

<p>Determine if the application has booted.</p>

Return Value

bool

void boot()

<p>Boot the application's service providers.</p>

Return Value

void

protected mixed bootProvider(ServiceProvider $provider)

<p>Boot the given service provider.</p>

Parameters

ServiceProvider $provider

Return Value

mixed

void booting(mixed $callback)

<p>Register a new boot listener.</p>

Parameters

mixed $callback

Return Value

void

void booted(mixed $callback)

<p>Register a new &quot;booted&quot; listener.</p>

Parameters

mixed $callback

Return Value

void

protected void fireAppCallbacks(array $callbacks)

<p>Call the booting callbacks for the application.</p>

Parameters

array $callbacks

Return Value

void

string getCachedCompilePath()

<p>Get the path to the cached &quot;compiled.php&quot; file.</p>

Return Value

string

string getCachedServicesPath()

<p>Get the path to the cached services.json file.</p>

Return Value

string

bool isDownForMaintenance()

<p>Determine if the application is currently down for maintenance.</p>

Return Value

bool

array getLoadedProviders()

<p>Get the service providers that have been loaded.</p>

Return Value

array

array getDeferredServices()

<p>Get the application's deferred services.</p>

Return Value

array

void setDeferredServices(array $services)

<p>Set the application's deferred services.</p>

Parameters

array $services

Return Value

void

void addDeferredServices(array $services)

<p>Add an array of services to the application's deferred services.</p>

Parameters

array $services

Return Value

void

bool isDeferredService(string $service)

<p>Determine if the given service is a deferred service.</p>

Parameters

string $service

Return Value

bool

registerCoreContainerAliases()

<p>Register the core class aliases in the container.</p>

flush()

<p>Flush the container of all bindings and resolved instances.</p>