PHP Class Flarum\Foundation\Application

Inheritance: extends Illuminate\Container\Container, implements Illuminate\Contracts\Foundation\Application
Mostrar archivo Open project: flarum/core Class Usage Examples

Protected Properties

Property Type Description
$basePath string The base path for the Flarum installation.
$booted boolean Indicates if the application has "booted".
$bootedCallbacks array The array of booted callbacks.
$bootingCallbacks array The array of booting callbacks.
$deferredServices array The deferred services and their providers.
$loadedProviders array The names of the loaded service providers.
$publicPath string The public path for the Flarum installation.
$serviceProviders array All of the registered service providers.
$storagePath string The custom storage path defined by the developer.

Public Methods

Method Description
__construct ( string | null $basePath = null, string | null $publicPath = null ) Create a new Flarum application instance.
addDeferredServices ( array $services ) : void Add an array of services to the application's deferred services.
basePath ( ) : string Get the base path of the Laravel installation.
boot ( ) : void Boot the application's service providers.
booted ( mixed $callback ) : void Register a new "booted" listener.
booting ( mixed $callback ) : void Register a new boot listener.
bound ( string $abstract ) : boolean Determine if the given abstract type has been bound.
config ( string $key, mixed $default = null ) : mixed
environment ( ) : string Get or check the current application environment.
flush ( ) Flush the container of all bindings and resolved instances.
getCachedCompilePath ( ) : string Get the path to the cached "compiled.php" file.
getCachedServicesPath ( ) : string Get the path to the cached services.json file.
getDeferredServices ( ) : array Get the application's deferred services.
getLoadedProviders ( ) : array Get the service providers that have been loaded.
getProvider ( ServiceProvider | string $provider ) : ServiceProvider | null Get the registered service provider instance if it exists.
inDebugMode ( ) : boolean Check if Flarum is in debug mode.
isBooted ( ) : boolean Determine if the application has booted.
isDeferredService ( string $service ) : boolean Determine if the given service is a deferred service.
isDownForMaintenance ( ) : boolean Determine if the application is currently down for maintenance.
isInstalled ( ) : boolean Determine if Flarum has been installed.
isUpToDate ( )
loadDeferredProvider ( string $service ) Load the provider for a deferred service.
loadDeferredProviders ( ) Load and boot all of the remaining deferred providers.
make ( string $abstract, array $parameters = [] ) : mixed Resolve the given type from the container.
publicPath ( ) : string Get the path to the public / web directory.
register ( ServiceProvider | string $provider, array $options = [], boolean $force = false ) : ServiceProvider Register a service provider with the application.
registerConfiguredProviders ( ) : void Register all of the configured providers.
registerCoreContainerAliases ( ) Register the core class aliases in the container.
registerDeferredProvider ( string $provider, string $service = null ) Register a deferred provider and service.
resolveProviderClass ( string $provider ) : ServiceProvider Resolve a service provider instance from the class name.
runningInConsole ( ) : boolean Determine if we are running in the console.
runningUnitTests ( ) : boolean Determine if we are running unit tests.
setBasePath ( string $basePath ) Set the base path for the application.
setDeferredServices ( array $services ) : void Set the application's deferred services.
setPublicPath ( string $publicPath ) Set the public path for the application.
storagePath ( ) : string Get the path to the storage directory.
url ( string $path = null ) : string Get the URL to the Flarum installation.
useStoragePath ( string $path ) Set the storage directory.
version ( ) : string Get the version number of the application.

Protected Methods

Method Description
bindPathsInContainer ( ) : void Bind all of the application paths in the container.
bootProvider ( ServiceProvider $provider ) : mixed Boot the given service provider.
fireAppCallbacks ( array $callbacks ) : void Call the booting callbacks for the application.
markAsRegistered ( ServiceProvider $provider ) : void Mark the given provider as registered.
registerBaseBindings ( ) Register the basic bindings into the container.
registerBaseServiceProviders ( ) Register all of the base service providers.

Method Details

__construct() public method

Create a new Flarum application instance.
public __construct ( string | null $basePath = null, string | null $publicPath = null )
$basePath string | null
$publicPath string | null

addDeferredServices() public method

Add an array of services to the application's deferred services.
public addDeferredServices ( array $services ) : void
$services array
return void

basePath() public method

Get the base path of the Laravel installation.
public basePath ( ) : string
return string

bindPathsInContainer() protected method

Bind all of the application paths in the container.
protected bindPathsInContainer ( ) : void
return void

boot() public method

Boot the application's service providers.
public boot ( ) : void
return void

bootProvider() protected method

Boot the given service provider.
protected bootProvider ( ServiceProvider $provider ) : mixed
$provider Illuminate\Support\ServiceProvider
return mixed

booted() public method

Register a new "booted" listener.
public booted ( mixed $callback ) : void
$callback mixed
return void

booting() public method

Register a new boot listener.
public booting ( mixed $callback ) : void
$callback mixed
return void

bound() public method

(Overriding Container::bound)
public bound ( string $abstract ) : boolean
$abstract string
return boolean

config() public method

public config ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
return mixed

environment() public method

Get or check the current application environment.
public environment ( ) : string
return string

fireAppCallbacks() protected method

Call the booting callbacks for the application.
protected fireAppCallbacks ( array $callbacks ) : void
$callbacks array
return void

flush() public method

Flush the container of all bindings and resolved instances.
public flush ( )

getCachedCompilePath() public method

Get the path to the cached "compiled.php" file.
public getCachedCompilePath ( ) : string
return string

getCachedServicesPath() public method

Get the path to the cached services.json file.
public getCachedServicesPath ( ) : string
return string

getDeferredServices() public method

Get the application's deferred services.
public getDeferredServices ( ) : array
return array

getLoadedProviders() public method

Get the service providers that have been loaded.
public getLoadedProviders ( ) : array
return array

getProvider() public method

Get the registered service provider instance if it exists.
public getProvider ( ServiceProvider | string $provider ) : ServiceProvider | null
$provider Illuminate\Support\ServiceProvider | string
return Illuminate\Support\ServiceProvider | null

inDebugMode() public method

Check if Flarum is in debug mode.
public inDebugMode ( ) : boolean
return boolean

isBooted() public method

Determine if the application has booted.
public isBooted ( ) : boolean
return boolean

isDeferredService() public method

Determine if the given service is a deferred service.
public isDeferredService ( string $service ) : boolean
$service string
return boolean

isDownForMaintenance() public method

Determine if the application is currently down for maintenance.
public isDownForMaintenance ( ) : boolean
return boolean

isInstalled() public method

Determine if Flarum has been installed.
public isInstalled ( ) : boolean
return boolean

isUpToDate() public method

public isUpToDate ( )

loadDeferredProvider() public method

Load the provider for a deferred service.
public loadDeferredProvider ( string $service )
$service string

loadDeferredProviders() public method

Load and boot all of the remaining deferred providers.

make() public method

(Overriding Container::make)
public make ( string $abstract, array $parameters = [] ) : mixed
$abstract string
$parameters array
return mixed

markAsRegistered() protected method

Mark the given provider as registered.
protected markAsRegistered ( ServiceProvider $provider ) : void
$provider Illuminate\Support\ServiceProvider
return void

publicPath() public method

Get the path to the public / web directory.
public publicPath ( ) : string
return string

register() public method

Register a service provider with the application.
public register ( ServiceProvider | string $provider, array $options = [], boolean $force = false ) : ServiceProvider
$provider Illuminate\Support\ServiceProvider | string
$options array
$force boolean
return Illuminate\Support\ServiceProvider

registerBaseBindings() protected method

Register the basic bindings into the container.
protected registerBaseBindings ( )

registerBaseServiceProviders() protected method

Register all of the base service providers.

registerConfiguredProviders() public method

Register all of the configured providers.
public registerConfiguredProviders ( ) : void
return void

registerCoreContainerAliases() public method

Register the core class aliases in the container.

registerDeferredProvider() public method

Register a deferred provider and service.
public registerDeferredProvider ( string $provider, string $service = null )
$provider string
$service string

resolveProviderClass() public method

Resolve a service provider instance from the class name.
public resolveProviderClass ( string $provider ) : ServiceProvider
$provider string
return Illuminate\Support\ServiceProvider

runningInConsole() public method

Determine if we are running in the console.
public runningInConsole ( ) : boolean
return boolean

runningUnitTests() public method

Determine if we are running unit tests.
public runningUnitTests ( ) : boolean
return boolean

setBasePath() public method

Set the base path for the application.
public setBasePath ( string $basePath )
$basePath string

setDeferredServices() public method

Set the application's deferred services.
public setDeferredServices ( array $services ) : void
$services array
return void

setPublicPath() public method

Set the public path for the application.
public setPublicPath ( string $publicPath )
$publicPath string

storagePath() public method

Get the path to the storage directory.
public storagePath ( ) : string
return string

url() public method

Get the URL to the Flarum installation.
public url ( string $path = null ) : string
$path string
return string

useStoragePath() public method

Set the storage directory.
public useStoragePath ( string $path )
$path string

version() public method

Get the version number of the application.
public version ( ) : string
return string

Property Details

$basePath protected_oe property

The base path for the Flarum installation.
protected string $basePath
return string

$booted protected_oe property

Indicates if the application has "booted".
protected bool $booted
return boolean

$bootedCallbacks protected_oe property

The array of booted callbacks.
protected array $bootedCallbacks
return array

$bootingCallbacks protected_oe property

The array of booting callbacks.
protected array $bootingCallbacks
return array

$deferredServices protected_oe property

The deferred services and their providers.
protected array $deferredServices
return array

$loadedProviders protected_oe property

The names of the loaded service providers.
protected array $loadedProviders
return array

$publicPath protected_oe property

The public path for the Flarum installation.
protected string $publicPath
return string

$serviceProviders protected_oe property

All of the registered service providers.
protected array $serviceProviders
return array

$storagePath protected_oe property

The custom storage path defined by the developer.
protected string $storagePath
return string