本文整理汇总了PHP中Composer\Composer::setPluginManager方法的典型用法代码示例。如果您正苦于以下问题:PHP Composer::setPluginManager方法的具体用法?PHP Composer::setPluginManager怎么用?PHP Composer::setPluginManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Composer
的用法示例。
在下文中一共展示了Composer::setPluginManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
$this->io = new BufferIO();
$this->composer = new Composer();
$this->composer->setPackage(new RootPackage('my/project', '1.0.0', '1.0.0'));
$this->composer->setPluginManager(new PluginManager($this->io, $this->composer));
$this->composer->setEventDispatcher(new EventDispatcher($this->composer, $this->io));
}
示例2: setUp
/**
* {@inheritdoc}
*/
protected function setUp()
{
$this->tempDir = __DIR__ . '/temp';
$this->config = new Config(false, realpath(__DIR__ . '/fixtures/local'));
$this->config->merge(['config' => ['home' => __DIR__]]);
$this->io = new BufferIO();
$this->composer = new Composer();
$this->composer->setConfig($this->config);
$this->composer->setPackage(new RootPackage('my/project', '1.0.0', '1.0.0'));
$this->composer->setPluginManager(new PluginManager($this->io, $this->composer));
$this->composer->setEventDispatcher(new EventDispatcher($this->composer, $this->io));
self::cleanTempDir();
mkdir($this->tempDir);
}
示例3: setUp
protected function setUp()
{
$loader = new JsonLoader(new ArrayLoader());
$this->packages = array();
$this->directory = $this->getUniqueTmpDirectory();
for ($i = 1; $i <= 7; $i++) {
$filename = '/Fixtures/plugin-v' . $i . '/composer.json';
mkdir(dirname($this->directory . $filename), 0777, true);
$this->packages[] = $loader->load(__DIR__ . $filename);
}
$dm = $this->getMockBuilder('Composer\\Downloader\\DownloadManager')->disableOriginalConstructor()->getMock();
$this->repository = $this->getMock('Composer\\Repository\\InstalledRepositoryInterface');
$rm = $this->getMockBuilder('Composer\\Repository\\RepositoryManager')->disableOriginalConstructor()->getMock();
$rm->expects($this->any())->method('getLocalRepository')->will($this->returnValue($this->repository));
$im = $this->getMock('Composer\\Installer\\InstallationManager');
$im->expects($this->any())->method('getInstallPath')->will($this->returnCallback(function ($package) {
return __DIR__ . '/Fixtures/' . $package->getPrettyName();
}));
$this->io = $this->getMock('Composer\\IO\\IOInterface');
$dispatcher = $this->getMockBuilder('Composer\\EventDispatcher\\EventDispatcher')->disableOriginalConstructor()->getMock();
$this->autoloadGenerator = new AutoloadGenerator($dispatcher);
$this->composer = new Composer();
$config = new Config();
$this->composer->setConfig($config);
$this->composer->setDownloadManager($dm);
$this->composer->setRepositoryManager($rm);
$this->composer->setInstallationManager($im);
$this->composer->setAutoloadGenerator($this->autoloadGenerator);
$this->pm = new PluginManager($this->io, $this->composer);
$this->composer->setPluginManager($this->pm);
$config->merge(array('config' => array('vendor-dir' => $this->directory . '/Fixtures/', 'home' => $this->directory . '/Fixtures', 'bin-dir' => $this->directory . '/Fixtures/bin')));
}