class ExtensionManager

Properties

protected $config
protected Paths $paths
protected $container
protected $migrator
protected Dispatcher $dispatcher
protected Filesystem $filesystem
protected Collection|null $extensions

Methods

__construct(SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem)

No description

Collection
getExtensions()

No description

Extension|null
getExtension(string $name)

<p>Loads an Extension with all information.</p>

enable(string $name)

<p>Enables the extension.</p>

disable(string $name)

<p>Disables an extension.</p>

uninstall(string $name)

<p>Uninstalls an extension.</p>

publishAssets(Extension $extension)

<p>Copy the assets from an extension's assets directory into public view.</p>

unpublishAssets(Extension $extension)

<p>Delete an extension's assets from public view.</p>

string
getAsset(Extension $extension, string $path)

<p>Get the path to an extension's published asset.</p>

void
migrate(Extension $extension, string $direction = 'up')

<p>Runs the database migrations for the extension.</p>

array
migrateDown(Extension $extension)

<p>Runs the database migrations to reset the database to its old state.</p>

getMigrator()

<p>The database migrator.</p>

array|Extension[]
getEnabledExtensions()

<p>Get only enabled extensions.</p>

extend(Container $app)

<p>Call on all enabled extensions to extend the Flarum application.</p>

array
getEnabled()

<p>The id's of the enabled extensions.</p>

setEnabled(array $enabled)

<p>Persist the currently enabled extensions.</p>

bool
isEnabled($extension)

<p>Whether the extension is enabled.</p>

Details

__construct(SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem)

Parameters

SettingsRepositoryInterface $config
Paths $paths
Container $container
Migrator $migrator
Dispatcher $dispatcher
Filesystem $filesystem

Collection getExtensions()

Return Value

Collection

Extension|null getExtension(string $name)

<p>Loads an Extension with all information.</p>

Parameters

string $name

Return Value

Extension|null

enable(string $name)

<p>Enables the extension.</p>

Parameters

string $name

disable(string $name)

<p>Disables an extension.</p>

Parameters

string $name

uninstall(string $name)

<p>Uninstalls an extension.</p>

Parameters

string $name

protected publishAssets(Extension $extension)

<p>Copy the assets from an extension's assets directory into public view.</p>

Parameters

Extension $extension

protected unpublishAssets(Extension $extension)

<p>Delete an extension's assets from public view.</p>

Parameters

Extension $extension

string getAsset(Extension $extension, string $path)

<p>Get the path to an extension's published asset.</p>

Parameters

Extension $extension
string $path

Return Value

string

void migrate(Extension $extension, string $direction = 'up')

<p>Runs the database migrations for the extension.</p>

Parameters

Extension $extension
string $direction

Return Value

void

array migrateDown(Extension $extension)

<p>Runs the database migrations to reset the database to its old state.</p>

Parameters

Extension $extension

Return Value

array <p>Notes from the migrator.</p>

Migrator getMigrator()

<p>The database migrator.</p>

Return Value

Migrator

array|Extension[] getEnabledExtensions()

<p>Get only enabled extensions.</p>

Return Value

array|Extension[]

extend(Container $app)

<p>Call on all enabled extensions to extend the Flarum application.</p>

Parameters

Container $app

array getEnabled()

<p>The id's of the enabled extensions.</p>

Return Value

array

protected setEnabled(array $enabled)

<p>Persist the currently enabled extensions.</p>

Parameters

array $enabled

bool isEnabled($extension)

<p>Whether the extension is enabled.</p>

Parameters

$extension

Return Value

bool