PHP Class Flarum\Extension\ExtensionManager

Afficher le fichier Open project: flarum/core Class Usage Examples

Protected Properties

Свойство Type Description
$app
$config
$dispatcher Illuminate\Contracts\Events\Dispatcher
$extensions Illuminate\Support\Collection | null
$filesystem Illuminate\Filesystem\Filesystem
$migrator

Méthodes publiques

Méthode Description
__construct ( Flarum\Settings\SettingsRepositoryInterface $config, Application $app, Flarum\Database\Migrator $migrator, Illuminate\Contracts\Events\Dispatcher $dispatcher, Illuminate\Filesystem\Filesystem $filesystem )
disable ( string $name ) Disables an extension.
enable ( string $name ) Enables the extension.
getAsset ( Extension $extension, string $path ) : string Get the path to an extension's published asset.
getEnabled ( ) : array The id's of the enabled extensions.
getEnabledBootstrappers ( ) : Collection Loads all bootstrap.php files of the enabled extensions.
getEnabledExtensions ( ) : Collection Get only enabled extensions.
getExtension ( string $name ) : Extension | null Loads an Extension with all information.
getExtensions ( ) : Collection
getMigrator ( ) : Flarum\Database\Migrator The database migrator.
isEnabled ( $extension ) : boolean Whether the extension is enabled.
migrate ( Extension $extension, boolean | true $up = true ) Runs the database migrations for the extension.
migrateDown ( Extension $extension ) Runs the database migrations to reset the database to its old state.
uninstall ( string $name ) Uninstalls an extension.

Méthodes protégées

Méthode Description
getExtensionsDir ( ) : string The extensions path.
publishAssets ( Extension $extension ) Copy the assets from an extension's assets directory into public view.
setEnabled ( array $enabled ) Persist the currently enabled extensions.
unpublishAssets ( Extension $extension ) Delete an extension's assets from public view.

Method Details

__construct() public méthode

public __construct ( Flarum\Settings\SettingsRepositoryInterface $config, Application $app, Flarum\Database\Migrator $migrator, Illuminate\Contracts\Events\Dispatcher $dispatcher, Illuminate\Filesystem\Filesystem $filesystem )
$config Flarum\Settings\SettingsRepositoryInterface
$app Flarum\Foundation\Application
$migrator Flarum\Database\Migrator
$dispatcher Illuminate\Contracts\Events\Dispatcher
$filesystem Illuminate\Filesystem\Filesystem

disable() public méthode

Disables an extension.
public disable ( string $name )
$name string

enable() public méthode

Enables the extension.
public enable ( string $name )
$name string

getAsset() public méthode

Get the path to an extension's published asset.
public getAsset ( Extension $extension, string $path ) : string
$extension Extension
$path string
Résultat string

getEnabled() public méthode

The id's of the enabled extensions.
public getEnabled ( ) : array
Résultat array

getEnabledBootstrappers() public méthode

Loads all bootstrap.php files of the enabled extensions.
public getEnabledBootstrappers ( ) : Collection
Résultat Illuminate\Support\Collection

getEnabledExtensions() public méthode

Get only enabled extensions.
public getEnabledExtensions ( ) : Collection
Résultat Illuminate\Support\Collection

getExtension() public méthode

Loads an Extension with all information.
public getExtension ( string $name ) : Extension | null
$name string
Résultat Extension | null

getExtensions() public méthode

public getExtensions ( ) : Collection
Résultat Illuminate\Support\Collection

getExtensionsDir() protected méthode

The extensions path.
protected getExtensionsDir ( ) : string
Résultat string

getMigrator() public méthode

The database migrator.
public getMigrator ( ) : Flarum\Database\Migrator
Résultat Flarum\Database\Migrator

isEnabled() public méthode

Whether the extension is enabled.
public isEnabled ( $extension ) : boolean
$extension
Résultat boolean

migrate() public méthode

Runs the database migrations for the extension.
public migrate ( Extension $extension, boolean | true $up = true )
$extension Extension
$up boolean | true

migrateDown() public méthode

Runs the database migrations to reset the database to its old state.
public migrateDown ( Extension $extension )
$extension Extension

publishAssets() protected méthode

Copy the assets from an extension's assets directory into public view.
protected publishAssets ( Extension $extension )
$extension Extension

setEnabled() protected méthode

Persist the currently enabled extensions.
protected setEnabled ( array $enabled )
$enabled array

uninstall() public méthode

Uninstalls an extension.
public uninstall ( string $name )
$name string

unpublishAssets() protected méthode

Delete an extension's assets from public view.
protected unpublishAssets ( Extension $extension )
$extension Extension

Property Details

$app protected_oe property

protected $app

$config protected_oe property

protected $config

$dispatcher protected_oe property

protected Dispatcher,Illuminate\Contracts\Events $dispatcher
Résultat Illuminate\Contracts\Events\Dispatcher

$extensions protected_oe property

protected Collection,Illuminate\Support|null $extensions
Résultat Illuminate\Support\Collection | null

$filesystem protected_oe property

protected Filesystem,Illuminate\Filesystem $filesystem
Résultat Illuminate\Filesystem\Filesystem

$migrator protected_oe property

protected $migrator