class ExtensionManager
Properties
| protected Extension>|null | $extensions |
|
||
| protected string[]|null | $pendingEnabledExtensions |
|
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.
Resolve the commit SHA for the actual installation source, ignoring `path` repositories (whose `dist.reference` can be a config hash or stale).
Details
at
line 45
__construct( SettingsRepositoryInterface $config, Paths $paths, Container $container, Migrator $migrator, Dispatcher $dispatcher, Filesystem $filesystem, MaintenanceMode $maintenance)
at
line 59
Collection
getExtensions()
at
line 150
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 162
Collection
getExtensionsById(array $ids)
at
line 177
void
enable(string $name)
at
line 221
void
disable(string $name)
at
line 263
void
uninstall(string $name)
at
line 281
protected void
publishAssets( Extension $extension)
Copy the assets from an extension's assets directory into public view.
at
line 289
protected void
unpublishAssets( Extension $extension)
Delete an extension's assets from public view.
at
line 297
string
getAsset( Extension $extension, string $path)
Get the path to an extension's published asset.
at
line 307
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 317
int|null
migrate( Extension $extension, string $direction = 'up')
Runs the database migrations for the extension.
at
line 327
Collection
getSettingsDefaults()
at
line 350
void
migrateConditional()
at
line 364
void
migrateDown( Extension $extension)
Runs the database migrations to reset the database to its old state.
at
line 380
array
getEnabledExtensions()
at
line 397
void
extend( Container $container)
Call on all enabled extensions to extend the Flarum application.
at
line 421
array
getEnabled()
The id's of the enabled extensions.
at
line 436
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 447
protected void
setEnabledExtensions(array $enabledExtensions)
Persist the currently enabled extensions.
at
line 461
array
sortDependencies(array $extensions)
Apply a topological sort to the extensions to ensure that they are in the correct order.
at
line 474
bool
isEnabled(string $extension)
at
line 487
static array
pluckTitles(array $extensions)
Returns the titles of the extensions passed.
at
line 509
static array
resolveExtensionOrder(array $extensionList)
Sort a list of extensions so that they are properly resolved in respect to order.
Effectively just topological sorting.
at
line 654
static protected bool
isDevVersion(string $version)
at
line 665
static protected string|null
extractCommit(array $package)
Resolve the commit SHA for the actual installation source, ignoring `path` repositories (whose `dist.reference` can be a config hash or stale).