$composer
$composer :
Plugin manager
__construct(\Composer\IO\IOInterface $io, \Composer\Composer $composer, \Composer\Composer $globalComposer = null, boolean $disablePlugins = false)
Initializes plugin manager
\Composer\IO\IOInterface | $io | |
\Composer\Composer | $composer | |
\Composer\Composer | $globalComposer | |
boolean | $disablePlugins |
getGlobalComposer() : \Composer\Composer|null
Gets global composer or null when main composer is not fully loaded
registerPackage(\Composer\Package\PackageInterface $package, boolean $failOnMissingClasses = false)
Register a plugin package, activate it etc.
If it's of type composer-installer it is registered as an installer instead for BC
\Composer\Package\PackageInterface | $package | |
boolean | $failOnMissingClasses | By default this silently skips plugins that can not be found, but if set to true it fails with an exception |
addPlugin(\Composer\Plugin\PluginInterface $plugin)
Adds a plugin, activates it and registers it with the event dispatcher
Ideally plugin packages should be registered via registerPackage, but if you use Composer programmatically and want to register a plugin class directly this is a valid way to do it.
\Composer\Plugin\PluginInterface | $plugin | plugin instance |
getPluginCapability(\Composer\Plugin\PluginInterface $plugin, string $capabilityClassName, array $ctorArgs = array()) : null|\Composer\Plugin\Capability\Capability
\Composer\Plugin\PluginInterface | $plugin | |
string | $capabilityClassName | The fully qualified name of the API interface which the plugin may provide an implementation of. |
array | $ctorArgs | Arguments passed to Capability's constructor. Keeping it an array will allow future values to be passed w\o changing the signature. |
getPluginCapabilities(string $capabilityClassName, array $ctorArgs = array()) : array<mixed,\Composer\Plugin\Capability\Capability>
string | $capabilityClassName | The fully qualified name of the API interface which the plugin may provide an implementation of. |
array | $ctorArgs | Arguments passed to Capability's constructor. Keeping it an array will allow future values to be passed w\o changing the signature. |
getCapabilityImplementationClassName(\Composer\Plugin\PluginInterface $plugin, string $capability) : null|string
\Composer\Plugin\PluginInterface | $plugin | |
string | $capability |
On empty or non-string implementation class name value
The fully qualified class of the implementation or null if Plugin is not of Capable type or does not provide it
loadRepository(\Composer\Repository\RepositoryInterface $repo)
Load all plugins and installers from a repository
Note that plugins in the specified repository that rely on events that have fired prior to loading will be missed. This means you likely want to call this method as early as possible.
\Composer\Repository\RepositoryInterface | $repo | Repository to scan for plugins to install |
collectDependencies(\Composer\DependencyResolver\Pool $pool, array $collected, \Composer\Package\PackageInterface $package) : array
Recursively generates a map of package names to packages for all deps
\Composer\DependencyResolver\Pool | $pool | Package pool of installed packages |
array | $collected | Current state of the map for recursion |
\Composer\Package\PackageInterface | $package | The package to analyze |
Map of package names to packages
lookupInstalledPackage(\Composer\DependencyResolver\Pool $pool, \Composer\Package\Link $link) : \Composer\Package\PackageInterface|null
Resolves a package link to a package in the installed pool
Since dependencies are already installed this should always find one.
\Composer\DependencyResolver\Pool | $pool | Pool of installed packages only |
\Composer\Package\Link | $link | Package link to look up |
The found package
getInstallPath(\Composer\Package\PackageInterface $package, boolean $global = false) : string
Retrieves the path a package is installed to.
\Composer\Package\PackageInterface | $package | |
boolean | $global | Whether this is a global package |
Install path