class ExtensionManager
Properties
| protected Extension>|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 39
__construct(SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem, MaintenanceMode $maintenance)
at
line 53
Collection
getExtensions()
at
line 144
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 156
Collection
getExtensionsById(array $ids)
at
line 163
Extension|null
getExtension(string $name)
at
line 171
void
enable(string $name)
at
line 209
void
disable(string $name)
at
line 243
void
uninstall(string $name)
at
line 261
protected void
publishAssets(Extension $extension)
Copy the assets from an extension's assets directory into public view.
at
line 269
protected void
unpublishAssets(Extension $extension)
Delete an extension's assets from public view.
at
line 277
string
getAsset(Extension $extension, string $path)
Get the path to an extension's published asset.
at
line 287
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 297
int|null
migrate(Extension $extension, string $direction = 'up')
Runs the database migrations for the extension.
at
line 311
void
migrateDown(Extension $extension)
Runs the database migrations to reset the database to its old state.
at
line 327
array
getEnabledExtensions()
at
line 344
void
extend(Container $container)
Call on all enabled extensions to extend the Flarum application.
at
line 368
array
getEnabled()
The id's of the enabled extensions.
at
line 380
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 391
protected void
setEnabledExtensions(array $enabledExtensions)
Persist the currently enabled extensions.
at
line 405
array
sortDependencies(array $extensions)
Apply a topological sort to the extensions to ensure that they are in the correct order.
at
line 418
bool
isEnabled(string $extension)
at
line 431
static array
pluckTitles(array $extensions)
Returns the titles of the extensions passed.
at
line 453
static array
resolveExtensionOrder(array $extensionList)
Sort a list of extensions so that they are properly resolved in respect to order.
Effectively just topological sorting.