1
0
Fork 0

Plugins receive composer and io objects on construction already

pull/2179/head
Nils Adermann 2013-08-14 18:47:25 +02:00
parent f00f5113bf
commit 9402a9fb3c
3 changed files with 14 additions and 6 deletions

View File

@ -22,9 +22,7 @@ use Composer\Composer;
interface PluginInterface interface PluginInterface
{ {
/** /**
* Apply plugin modifications to the passed in composer object * Apply plugin modifications to composer
*
* @param Composer $composer
*/ */
public function activate(Composer $composer); public function activate();
} }

View File

@ -64,7 +64,7 @@ class PluginManager
public function addPlugin(PluginInterface $plugin) public function addPlugin(PluginInterface $plugin)
{ {
$this->plugins[] = $plugin; $this->plugins[] = $plugin;
$plugin->activate($this->composer); $plugin->activate();
if ($plugin instanceof EventSubscriberInterface) { if ($plugin instanceof EventSubscriberInterface) {
$this->composer->getEventDispatcher()->addSubscriber($plugin); $this->composer->getEventDispatcher()->addSubscriber($plugin);
@ -102,7 +102,7 @@ class PluginManager
self::$classCounter++; self::$classCounter++;
} }
$plugin = new $class($this->io, $this->composer); $plugin = new $class($this->composer, $this->io);
if ($oldInstallerPlugin) { if ($oldInstallerPlugin) {
$this->composer->getInstallationManager()->addInstaller($installer); $this->composer->getInstallationManager()->addInstaller($installer);

View File

@ -76,6 +76,16 @@ class RemoteFilesystem
return $this->get($originUrl, $fileUrl, $options, null, $progress); 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. * Get file content or copy action.
* *