Plugins receive composer and io objects on construction already
parent
f00f5113bf
commit
9402a9fb3c
|
@ -22,9 +22,7 @@ use Composer\Composer;
|
|||
interface PluginInterface
|
||||
{
|
||||
/**
|
||||
* Apply plugin modifications to the passed in composer object
|
||||
*
|
||||
* @param Composer $composer
|
||||
* Apply plugin modifications to composer
|
||||
*/
|
||||
public function activate(Composer $composer);
|
||||
public function activate();
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class PluginManager
|
|||
public function addPlugin(PluginInterface $plugin)
|
||||
{
|
||||
$this->plugins[] = $plugin;
|
||||
$plugin->activate($this->composer);
|
||||
$plugin->activate();
|
||||
|
||||
if ($plugin instanceof EventSubscriberInterface) {
|
||||
$this->composer->getEventDispatcher()->addSubscriber($plugin);
|
||||
|
@ -102,7 +102,7 @@ class PluginManager
|
|||
self::$classCounter++;
|
||||
}
|
||||
|
||||
$plugin = new $class($this->io, $this->composer);
|
||||
$plugin = new $class($this->composer, $this->io);
|
||||
|
||||
if ($oldInstallerPlugin) {
|
||||
$this->composer->getInstallationManager()->addInstaller($installer);
|
||||
|
|
|
@ -76,6 +76,16 @@ class RemoteFilesystem
|
|||
return $this->get($originUrl, $fileUrl, $options, null, $progress);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the options set in the constructor
|
||||
*
|
||||
* @return array Options
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file content or copy action.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue