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


PHP Composer::setConfig方法代碼示例

本文整理匯總了PHP中Composer\Composer::setConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Composer::setConfig方法的具體用法?PHP Composer::setConfig怎麽用?PHP Composer::setConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Composer的用法示例。


在下文中一共展示了Composer::setConfig方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: setUp

 protected function setUp()
 {
     $this->fs = new Filesystem();
     $this->composer = new Composer();
     $this->config = new Config();
     $this->composer->setConfig($this->config);
     $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-vendor';
     $this->ensureDirectoryExistsAndClear($this->vendorDir);
     $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-bin';
     $this->ensureDirectoryExistsAndClear($this->binDir);
     $this->config->merge(array('config' => array('vendor-dir' => $this->vendorDir, 'bin-dir' => $this->binDir)));
     $this->dm = $this->getMockBuilder('Composer\\Downloader\\DownloadManager')->disableOriginalConstructor()->getMock();
     /* @var DownloadManager $dm */
     $dm = $this->dm;
     $this->composer->setDownloadManager($dm);
     $this->repository = $this->getMock('Composer\\Repository\\InstalledRepositoryInterface');
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
     $this->type = $this->getMock('Fxp\\Composer\\AssetPlugin\\Type\\AssetTypeInterface');
     $this->type->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $this->type->expects($this->any())->method('getComposerVendorName')->will($this->returnValue('foo-asset'));
     $this->type->expects($this->any())->method('getComposerType')->will($this->returnValue('foo-asset-library'));
     $this->type->expects($this->any())->method('getFilename')->will($this->returnValue('foo.json'));
     $this->type->expects($this->any())->method('getVersionConverter')->will($this->returnValue($this->getMock('Fxp\\Composer\\AssetPlugin\\Converter\\VersionConverterInterface')));
     $this->type->expects($this->any())->method('getPackageConverter')->will($this->returnValue($this->getMock('Fxp\\Composer\\AssetPlugin\\Converter\\PackageConverterInterface')));
 }
開發者ID:MvegaR,項目名稱:ingSotfware,代碼行數:25,代碼來源:BowerInstallerTest.php

示例3: setUp

 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->fs = new SymlinkFilesystem();
     $this->composer = new Composer();
     $this->config = new Config();
     $this->composer->setConfig($this->config);
     $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-vendor';
     $this->ensureDirectoryExistsAndClear($this->vendorDir);
     $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-bin';
     $this->ensureDirectoryExistsAndClear($this->binDir);
     $this->dependenciesDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-dependencies';
     $this->ensureDirectoryExistsAndClear($this->dependenciesDir);
     $this->symlinkDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'composer-test-vendor-shared';
     $this->config->merge(array('config' => array('vendor-dir' => $this->vendorDir, 'bin-dir' => $this->binDir)));
     $this->dm = $this->getMockBuilder('Composer\\Downloader\\DownloadManager')->disableOriginalConstructor()->getMock();
     $this->composer->setDownloadManager($this->dm);
     /** @var RootPackage|\PHPUnit_Framework_MockObject_MockObject $package */
     $package = $this->getMock('Composer\\Package\\RootPackageInterface');
     $package->expects($this->any())->method('getExtra')->willReturn(array(SharedPackageInstaller::PACKAGE_TYPE => array('vendor-dir' => $this->dependenciesDir, 'symlink-dir' => $this->symlinkDir)));
     $this->composer->setPackage($package);
     $this->repository = $this->getMock('Composer\\Repository\\InstalledRepositoryInterface');
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
     $this->dataManager = $this->getMockBuilder('LEtudiant\\Composer\\Data\\Package\\SharedPackageDataManager')->disableOriginalConstructor()->getMock();
 }
開發者ID:JasLin,項目名稱:composer-shared-package-plugin,代碼行數:28,代碼來源:SharedPackageInstallerTest.php

示例4: setUp

 protected function setUp()
 {
     $this->composer = new Composer();
     $this->config = new Config();
     $this->composer->setConfig($this->config);
     $this->composer->setInstallationManager(new InstallationManager());
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
 }
開發者ID:bernardosilva,項目名稱:git-hooks-installer-plugin,代碼行數:8,代碼來源:PluginTest.php

示例5: testActivate

 /**
  * All we can do is confirm that the plugin tried to register the
  * correct installer class during ::activate().
  *
  * @return void
  */
 public function testActivate()
 {
     $this->composer = $this->getMock('Composer\\Composer', ['getInstallationManager', 'addInstaller']);
     $this->composer->setConfig(new Config(false));
     $this->composer->expects($this->once())->method('getInstallationManager')->will($this->returnSelf());
     $this->composer->expects($this->once())->method('addInstaller')->with($this->isInstanceOf('Loadsys\\Composer\\PuphpetReleaseInstaller'));
     $this->plugin->activate($this->composer, $this->io);
 }
開發者ID:loadsys,項目名稱:puphpet-release-composer-installer,代碼行數:14,代碼來源:PuphpetReleaseInstallerPluginTest.php

示例6: setUp

 /**
  * Runs before each test.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->package = $this->getMockBuilder(Package::class)->setConstructorArgs(array(md5(mt_rand()), '1.0.0.0', '1.0.0'))->getMock();
     //$this->createPackageMock(); //new Package('CamelCased', '1.0', '1.0');
     $this->io = $this->getMock(IOInterface::class);
     $this->composer = new Composer();
     $this->composer->setConfig(new Config(false));
     $this->repository = $this->getMock(InstalledRepositoryInterface::class);
 }
開發者ID:loadsys,項目名稱:puphpet-release-composer-installer,代碼行數:15,代碼來源:PuphpetReleaseInstallerTest.php

示例7: setUp

 public function setUp()
 {
     $this->plugin = $this->getMock('\\ContaoCommunityAlliance\\Composer\\Plugin\\Plugin');
     $this->plugin->expects($this->any())->method('getContaoRoot')->will($this->returnValue('CONTAO_ROOT'));
     $package = new RootPackage('test/me', '0.8.15', '0.8.15.0');
     $package->setType(AbstractInstaller::MODULE_TYPE);
     $this->composer = new Composer();
     $this->composer->setConfig(new Config());
     $this->composer->setPackage($package);
     $this->installerStub = $this->getMockForAbstractClass('\\ContaoCommunityAlliance\\Composer\\Plugin\\AbstractInstaller', array(new NullIO(), $this->composer, $this->plugin));
 }
開發者ID:Jobu,項目名稱:core,代碼行數:11,代碼來源:GetSourcesSpecTest.php

示例8: setUp

 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->localConfigPath = realpath(__DIR__ . '/../fixtures/local');
     $this->globalConfigPath = realpath(__DIR__ . '/../fixtures/home');
     $this->config = new Config(false, $this->localConfigPath);
     $this->config->merge(['config' => ['home' => $this->globalConfigPath]]);
     $package = new RootPackage('my/project', '1.0.0', '1.0.0');
     $package->setExtra(['my-local-config' => ['foo' => 'bar']]);
     $this->composer = new Composer();
     $this->composer->setConfig($this->config);
     $this->composer->setPackage($package);
     $this->SUT = new ConfigLocator($this->composer);
 }
開發者ID:pyrech,項目名稱:composer-changelogs,代碼行數:16,代碼來源:ConfigLocatorTest.php

示例9: 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

示例10: setUp

 /**
  * @inheritdoc
  */
 protected function setUp()
 {
     parent::setUp();
     $this->composer = new Composer();
     $config = new Config();
     $this->composer->setConfig($config);
     /** @var RootPackageInterface|\PHPUnit_Framework_MockObject_MockObject $package */
     $package = $this->getMock('Composer\\Package\\RootPackageInterface');
     $package->expects($this->any())->method('getExtra')->willReturn(array(SharedPackageInstaller::PACKAGE_TYPE => array('vendor-dir' => sys_get_temp_dir() . '/composer-test-vendor-shared')));
     $this->composer->setPackage($package);
     $this->im = $this->getMock('Composer\\Installer\\InstallationManager');
     $this->composer->setInstallationManager($this->im);
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
 }
開發者ID:letudiant,項目名稱:composer-shared-package-plugin,代碼行數:17,代碼來源:SharedPackagePluginTest.php

示例11: setUp

 public function setUp()
 {
     $composer = new Composer();
     $composer->setConfig(new Config());
     $io = $this->getMock('Composer\\IO\\IOInterface');
     $this->installer = new Installer($io, $composer);
 }
開發者ID:ZerGabriel,項目名稱:composer-installer,代碼行數:7,代碼來源:InstallerTest.php

示例12: setUp

 protected function setUp()
 {
     while (false === mkdir($this->tempDir = sys_get_temp_dir() . '/puli-plugin/PuliPluginTest_root' . rand(10000, 99999), 0777, true)) {
     }
     $filesystem = new Filesystem();
     $filesystem->mirror(__DIR__ . '/Fixtures/root', $this->tempDir);
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
     $this->config = new Config(false, $this->tempDir);
     $this->config->merge(array('config' => array('vendor-dir' => 'the-vendor')));
     $this->installationManager = $this->getMockBuilder('Composer\\Installer\\InstallationManager')->disableOriginalConstructor()->getMock();
     $this->installationManager->expects($this->any())->method('getInstallPath')->will($this->returnCallback(array($this, 'getInstallPath')));
     $this->rootPackage = new RootPackage('vendor/root', '1.0', '1.0');
     $this->localRepository = new TestLocalRepository(array(new Package('vendor/package1', '1.0', '1.0'), new Package('vendor/package2', '1.0', '1.0')));
     $this->repositoryManager = new RepositoryManager($this->io, $this->config);
     $this->repositoryManager->setLocalRepository($this->localRepository);
     $this->installPaths = array();
     $this->composer = new Composer();
     $this->composer->setRepositoryManager($this->repositoryManager);
     $this->composer->setInstallationManager($this->installationManager);
     $this->composer->setConfig($this->config);
     $this->composer->setPackage($this->rootPackage);
     $this->puliRunner = $this->getMockBuilder('Puli\\ComposerPlugin\\PuliRunner')->disableOriginalConstructor()->getMock();
     $this->previousWd = getcwd();
     chdir($this->tempDir);
     $this->plugin = new PuliPlugin($this->puliRunner);
 }
開發者ID:niklongstone,項目名稱:composer-plugin,代碼行數:26,代碼來源:PuliPluginTest.php

示例13: createComposerInstance

 private function createComposerInstance()
 {
     $composer = new Composer();
     $config = new Config();
     $composer->setConfig($config);
     return $composer;
 }
開發者ID:detain,項目名稱:composer,代碼行數:7,代碼來源:RunScriptCommandTest.php

示例14: setUp

 /**
  * setUp
  * 
  * @return void
  */
 public function setUp()
 {
     $this->fs = new Filesystem();
     $this->composer = new Composer();
     $this->config = new Config();
     $this->composer->setConfig($this->config);
     $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
     $this->ensureDirectoryExistsAndClear($this->vendorDir);
     $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
     $this->ensureDirectoryExistsAndClear($this->binDir);
     $this->config->merge(array('config' => array('vendor-dir' => $this->vendorDir, 'bin-dir' => $this->binDir)));
     $this->dm = $this->getMockBuilder('Composer\\Downloader\\DownloadManager')->disableOriginalConstructor()->getMock();
     $this->composer->setDownloadManager($this->dm);
     $this->repository = $this->getMock('Composer\\Repository\\InstalledRepositoryInterface');
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
 }
開發者ID:fancyguy,項目名稱:webroot-installer,代碼行數:21,代碼來源:WebrootInstallerTest.php

示例15: setUp

 protected function setUp()
 {
     $this->tempDir = TestUtil::makeTempDir('puli-composer-plugin', __CLASS__);
     $filesystem = new Filesystem();
     $filesystem->mirror(__DIR__ . '/Fixtures/root', $this->tempDir);
     $this->io = $this->getMock('Composer\\IO\\IOInterface');
     $this->config = new Config(false, $this->tempDir);
     $this->config->merge(array('config' => array('vendor-dir' => 'the-vendor')));
     $this->installationManager = $this->getMockBuilder('Composer\\Installer\\InstallationManager')->disableOriginalConstructor()->getMock();
     $this->installationManager->expects($this->any())->method('getInstallPath')->will($this->returnCallback(array($this, 'getInstallPath')));
     $this->rootPackage = new RootPackage('vendor/root', '1.0', '1.0');
     $this->rootPackage->setRequires(array('vendor/package1' => new Link('vendor/root', 'vendor/package1'), 'vendor/package2' => new Link('vendor/root', 'vendor/package2')));
     $this->localRepository = new TestLocalRepository(array(new Package('vendor/package1', '1.0', '1.0'), new Package('vendor/package2', '1.0', '1.0')));
     $this->repositoryManager = new RepositoryManager($this->io, $this->config);
     $this->repositoryManager->setLocalRepository($this->localRepository);
     $this->installPaths = array();
     $this->composer = new Composer();
     $this->composer->setRepositoryManager($this->repositoryManager);
     $this->composer->setInstallationManager($this->installationManager);
     $this->composer->setConfig($this->config);
     $this->composer->setPackage($this->rootPackage);
     $this->puliRunner = $this->getMockBuilder('Puli\\ComposerPlugin\\PuliRunner')->disableOriginalConstructor()->getMock();
     $this->previousWd = getcwd();
     chdir($this->tempDir);
     $this->plugin = new PuliPlugin($this->puliRunner);
 }
開發者ID:kormik,項目名稱:composer-plugin,代碼行數:26,代碼來源:PuliPluginTest.php


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