class ExtensionManager
Properties
| protected Collection|null | $extensions |
|
Methods
No description
Returns a flat list of all installed composer package names (including non-extension packages).
Copy the assets from an extension's assets directory into public view.
Runs the database migrations to reset the database to its old state.
Re-sort and persist the enabled extension order based on current composer.json dependency declarations. Call this after a composer update so that any new or changed optional-dependencies are reflected without requiring a manual enable/disable cycle.
Apply a topological sort to the extensions to ensure that they are in the correct order.
Sort a list of extensions so that they are properly resolved in respect to order.
Details
at
line 35
__construct(SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem, MaintenanceMode $maintenance)
at
line 46
Collection
getExtensions()
at
line 122
array
getInstalledPackageNames()
Returns a flat list of all installed composer package names (including non-extension packages).
Useful for checking whether a suggested package is already installed.
at
line 134
Collection
getExtensionsById(array $ids)
at
line 141
Extension|null
getExtension(string $name)
at
line 149
void
enable(string $name)
at
line 187
void
disable(string $name)
at
line 221
void
uninstall(string $name)
at
line 239
protected void
publishAssets(Extension $extension)
Copy the assets from an extension's assets directory into public view.
at
line 247
protected void
unpublishAssets(Extension $extension)
Delete an extension's assets from public view.
at
line 255
string
getAsset(Extension $extension, string $path)
Get the path to an extension's published asset.
at
line 265
protected Cloud
getAssetsFilesystem()
Get an instance of the `assets` filesystem.
This is resolved dynamically because Flarum's filesystem configuration might not be booted yet when the ExtensionManager singleton initializes.
at
line 275
int|null
migrate(Extension $extension, string $direction = 'up')
Runs the database migrations for the extension.
at
line 289
void
migrateDown(Extension $extension)
Runs the database migrations to reset the database to its old state.
at
line 305
array
getEnabledExtensions()
at
line 322
void
extend(Container $container)
Call on all enabled extensions to extend the Flarum application.
at
line 346
array
getEnabled()
The id's of the enabled extensions.
at
line 358
void
syncExtensionOrder()
Re-sort and persist the enabled extension order based on current composer.json dependency declarations. Call this after a composer update so that any new or changed optional-dependencies are reflected without requiring a manual enable/disable cycle.
at
line 369
protected void
setEnabledExtensions(array $enabledExtensions)
Persist the currently enabled extensions.
at
line 383
array
sortDependencies(array $extensions)
Apply a topological sort to the extensions to ensure that they are in the correct order.
at
line 396
bool
isEnabled(string $extension)
at
line 409
static array
pluckTitles(array $extensions)
Returns the titles of the extensions passed.
at
line 431
static array
resolveExtensionOrder(array $extensionList)
Sort a list of extensions so that they are properly resolved in respect to order.
Effectively just topological sorting.