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 36
__construct(SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem, MaintenanceMode $maintenance)
at
line 47
Collection
getExtensions()
at
line 137
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 149
Collection
getExtensionsById(array $ids)
at
line 156
Extension|null
getExtension(string $name)
at
line 164
void
enable(string $name)
at
line 202
void
disable(string $name)
at
line 236
void
uninstall(string $name)
at
line 254
protected void
publishAssets(Extension $extension)
Copy the assets from an extension's assets directory into public view.
at
line 262
protected void
unpublishAssets(Extension $extension)
Delete an extension's assets from public view.
at
line 270
string
getAsset(Extension $extension, string $path)
Get the path to an extension's published asset.
at
line 280
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 290
int|null
migrate(Extension $extension, string $direction = 'up')
Runs the database migrations for the extension.
at
line 304
void
migrateDown(Extension $extension)
Runs the database migrations to reset the database to its old state.
at
line 320
array
getEnabledExtensions()
at
line 337
void
extend(Container $container)
Call on all enabled extensions to extend the Flarum application.
at
line 361
array
getEnabled()
The id's of the enabled extensions.
at
line 373
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 384
protected void
setEnabledExtensions(array $enabledExtensions)
Persist the currently enabled extensions.
at
line 398
array
sortDependencies(array $extensions)
Apply a topological sort to the extensions to ensure that they are in the correct order.
at
line 411
bool
isEnabled(string $extension)
at
line 424
static array
pluckTitles(array $extensions)
Returns the titles of the extensions passed.
at
line 446
static array
resolveExtensionOrder(array $extensionList)
Sort a list of extensions so that they are properly resolved in respect to order.
Effectively just topological sorting.