1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Implement a plugin manager and interface, update installer plugin tests

This commit is contained in:
Nils Adermann 2013-08-13 15:55:52 +02:00
parent 01a08a2ff3
commit eb966d347f
23 changed files with 238 additions and 156 deletions

View file

@ -0,0 +1,49 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Plugin;
use Composer\Composer;
use Composer\Package\PackageInterface;
/**
* Plugin manager
*
* @author Nils Adermann <naderman@naderman.de>
*/
class PluginManager
{
protected $composer;
protected $plugins = array();
/**
* Initializes plugin manager
*
* @param Composer $composer
*/
public function __construct(Composer $composer)
{
$this->composer = $composer;
}
/**
* Adds plugin
*
* @param PluginInterface $plugin plugin instance
*/
public function addPlugin(PluginInterface $plugin)
{
$this->plugins[] = $plugin;
$plugin->activate($this->composer);
}
}