當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Composer::setPluginManager方法代碼示例

本文整理匯總了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));
 }
開發者ID:e-tipalchuk,項目名稱:composer-changelogs,代碼行數:11,代碼來源:ChangelogsPluginTest.php

示例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);
 }
開發者ID:pyrech,項目名稱:composer-changelogs,代碼行數:17,代碼來源:ChangelogsPluginTest.php

示例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')));
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:32,代碼來源:PluginInstallerTest.php


注:本文中的Composer\Composer::setPluginManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。