当前位置: 首页>>代码示例>>PHP>>正文


PHP Package::setType方法代码示例

本文整理汇总了PHP中Composer\Package\Package::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::setType方法的具体用法?PHP Package::setType怎么用?PHP Package::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\Package\Package的用法示例。


在下文中一共展示了Package::setType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createPackage

 /**
  * @param string $type
  * @param string $targetDir
  * @param array $autoload
  * @return \Composer\Package\Package
  */
 protected function createPackage($name, $type, array $autoload)
 {
     $package = new Package($name, 'dev-master', '9999999-dev');
     $package->setType($type);
     $package->setAutoload($autoload);
     return $package;
 }
开发者ID:frogriotcom,项目名称:CheckBundles,代码行数:13,代码来源:ComposerHelperTest.php

示例2: testGetPackageBasePath

 /**
  * testGetPackageBasePath
  *
  * @dataProvider dataForTestInstallPath
  */
 public function testGetPackageBasePath($type, $path, $name, $version = '1.0.0')
 {
     $installer = new ThemeInstaller($this->io, $this->composer, $type);
     $package = new Package($name, $version, $version);
     $package->setType($type);
     $result = $installer->getPackageBasePath($package);
     $this->assertEquals($path, $result);
 }
开发者ID:lappuse,项目名称:composer-installer,代码行数:13,代码来源:ThemeInstallerTest.php

示例3: testInstallPath

 /**
  * testInstallPath
  *
  * @dataProvider dataForTestInstallPath
  */
 public function testInstallPath($type, $path, $name)
 {
     $installer = new CodeigniterInstaller($this->io, $this->composer);
     $package = new Package($name, '1.0.0', '1.0.0');
     $package->setType($type);
     $result = $installer->getInstallPath($package);
     $this->assertEquals($path, $result);
 }
开发者ID:alex-krav,项目名称:personal-page-codeigniter,代码行数:13,代码来源:CodeigniterInstallerTest.php

示例4: getInstalledPackages

 public function getInstalledPackages()
 {
     $fooPackage = new Package('acme/foo-bundle', 'dev-master', '9999999-dev');
     $fooPackage->setAutoload(array('psr-0' => array('Acme\\FooBundle' => '')));
     $fooPackage->setType('symfony-bundle');
     $barPackage = new Package('acme/bar-bundle', 'dev-master', '9999999-dev');
     $barPackage->setAutoload(array('psr-0' => array('Acme\\BarBundle' => 'src/')));
     $barPackage->setType('symfony-bundle');
     $fooBarPackage = new Package('acme/foobar-bundle', 'dev-master', '9999999-dev');
     $fooBarPackage->setAutoload(array('psr-4' => array('Acme\\FooBarBundle\\' => '')));
     $fooBarPackage->setType('symfony-bundle');
     return array($fooPackage, $barPackage, $fooBarPackage);
 }
开发者ID:frogriotcom,项目名称:CheckBundles,代码行数:13,代码来源:ComposerTestCase.php

示例5: testInstallPath

 /**
  * testInstallPath
  *
  * @dataProvider dataForInstallPath
  */
 public function testInstallPath($name, $type, $path, $expected)
 {
     $composer = new Composer();
     $config = new Config();
     $composer->setConfig($config);
     $repository = $this->getMock('Composer\\Repository\\InstalledRepositoryInterface');
     $io = $this->getMock('Composer\\IO\\IOInterface');
     $installer = new CustomInstaller($io, $composer);
     $package = new Package($name, '1.0.0', '1.0.0');
     $package->setType($type);
     $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
     $composer->setPackage($consumerPackage);
     $consumerPackage->setExtra(array('custom-installer' => array($type => $path)));
     $result = $installer->getInstallPath($package);
     $this->assertEquals($expected, $result);
 }
开发者ID:neyensp,项目名称:custom-installer,代码行数:21,代码来源:CustomInstallerTest.php

示例6: dataPackages

 public function dataPackages()
 {
     $metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
     $metapackage->setType('metapackage');
     $package1 = new Package('vendor/name', '1.0.0.0', '1.0');
     $package2 = new Package('vendor/name', 'dev-master', 'dev-master');
     $package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
     $package3->setProvides([new Link('', 'vendor/name')]);
     $data = [];
     $data['metapackage'] = [true, $metapackage, []];
     $data['skipDev is true, but package is not'] = [false, $package1, ['skip-dev' => 1]];
     $data['skipDev is true, package isDev'] = [true, $package2, ['skip-dev' => 1]];
     $data['package in whitelist'] = [false, $package1, ['whitelist' => ['vendor/name']]];
     $data['package not in whitelist'] = [true, $package1, ['whitelist' => ['othervendor/othername']]];
     $data['package in blacklist'] = [true, $package1, ['blacklist' => ['vendor/name']]];
     $data['package not in blacklist'] = [false, $package1, ['blacklist' => ['othervendor/othername']]];
     $data['package provides a virtual package in blacklist'] = [true, $package3, ['blacklist' => ['vendor/name']]];
     return $data;
 }
开发者ID:composer,项目名称:satis,代码行数:19,代码来源:ArchiveBuilderHelperTest.php

示例7: dataPackages

 public function dataPackages()
 {
     $metapackage = new Package('vendor/name', '1.0.0.0', '1.0');
     $metapackage->setType('metapackage');
     $package1 = new Package('vendor/name', '1.0.0.0', '1.0');
     $package2 = new Package('vendor/name', 'dev-master', 'dev-master');
     $package3 = new Package('othervendor/othername', '1.0.0.0', '1.0');
     $package3->setProvides(array(new Link('', 'vendor/name')));
     $data = array();
     $data['metapackage'] = array(true, $metapackage, array());
     $data['skipDev is true, but package is not'] = array(false, $package1, array('skip-dev' => 1));
     $data['skipDev is true, package isDev'] = array(true, $package2, array('skip-dev' => 1));
     $data['package in whitelist'] = array(false, $package1, array('whitelist' => array('vendor/name')));
     $data['package not in whitelist'] = array(true, $package1, array('whitelist' => array('othervendor/othername')));
     $data['package in blacklist'] = array(true, $package1, array('blacklist' => array('vendor/name')));
     $data['package not in blacklist'] = array(false, $package1, array('blacklist' => array('othervendor/othername')));
     $data['package provides a virtual package in blacklist'] = array(true, $package3, array('blacklist' => array('vendor/name')));
     return $data;
 }
开发者ID:ausger,项目名称:satis,代码行数:19,代码来源:ArchiveBuilderHelperTest.php

示例8: resolvePackageDependencies

 private function resolvePackageDependencies($repository, $packages, $packageName)
 {
     $config = $packages[$packageName];
     foreach ($config['deps'] as $dependencyName) {
         if ($dependencyName === 'vendor/php' || strpos($dependencyName, 'vendor/ext-') === 0 || strpos($dependencyName, 'vendor/lib-') === 0) {
             continue;
         }
         if (!isset($packages[$dependencyName])) {
             throw new \RuntimeException("Requiring non existant package '" . $dependencyName . "' in '" . $packageName . "'.");
         }
         $dependency = $packages[$dependencyName];
         $package = new Package($dependency['path'], "@stable", "@stable");
         $package->setType('fiddler');
         if (isset($dependency['autoload']) && is_array($dependency['autoload'])) {
             $package->setAutoload($dependency['autoload']);
         }
         if (!$repository->hasPackage($package)) {
             $repository->addPackage($package);
             $this->resolvePackageDependencies($repository, $packages, $dependencyName);
         }
     }
 }
开发者ID:sidisinsane,项目名称:fiddler,代码行数:22,代码来源:Build.php

示例9: testGetCakePHPInstallPathException

 /**
  * testGetCakePHPInstallPathException
  *
  * @return void
  *
  * @expectedException \InvalidArgumentException
  */
 public function testGetCakePHPInstallPathException()
 {
     $installer = new Installer($this->io, $this->composer);
     $package = new Package('shama/ftp', '1.0.0', '1.0.0');
     $package->setType('cakephp-whoops');
     $result = $installer->getInstallPath($package);
 }
开发者ID:monofone,项目名称:ansible-installer,代码行数:14,代码来源:InstallerTest.php

示例10: addPackages

 /**
  * @param array $releases
  * @param string $connectPackage
  * @return RepositoryInterface
  */
 private function addPackages(array $releases, $connectPackage)
 {
     return new ArrayRepository(array_map(function ($release) use($connectPackage) {
         $distUrl = sprintf($this->distUrlFormat, $connectPackage, $release, $connectPackage, $release);
         $package = new Package(strtolower($connectPackage), $release, $release);
         $package->setDistUrl($distUrl);
         $package->setDistType('tar');
         $package->setType('magento-module');
         $package->setExtra(['package-xml' => "package.xml"]);
         return $package;
     }, $releases));
 }
开发者ID:adam-paterson,项目名称:magento-connect-composer-plugin,代码行数:17,代码来源:Plugin.php

示例11: createPackage

 public function createPackage($name, $ns, $type = 'symfony-bundle')
 {
     $package = new Package($name, '1.0.0', '1.0.0');
     $package->setType($type);
     $package->setAutoload(['psr-4' => [$ns => '']]);
     return $package;
 }
开发者ID:fuzzyma,项目名称:composer-register-bundle-plugin,代码行数:7,代码来源:RegisterCommandTest.php

示例12: addPackages

 /**
  * @param array $releases
  * @param string $connectPackage
  * @param VersionParser $versionParser
  * @return RepositoryInterface
  */
 private function addPackages(array $releases, $connectPackage, VersionParser $versionParser)
 {
     $releases = array_filter($releases, function ($release) use($versionParser) {
         try {
             $versionParser->normalize($release);
         } catch (UnexpectedValueException $e) {
             $this->writeVerbose(sprintf('Version "%s" is not valid. Skipping this version.', $release));
             return false;
         }
         return true;
     });
     return new ArrayRepository(array_map(function ($release) use($connectPackage, $versionParser) {
         $distUrl = sprintf($this->distUrlFormat, $connectPackage, $release, $connectPackage, $release);
         $release = $versionParser->normalize($release);
         $package = new Package(strtolower($connectPackage), $release, $release);
         $package->setDistUrl($distUrl);
         $package->setDistType('tar');
         $package->setType('magento-module');
         $package->setExtra(['package-xml' => "package.xml"]);
         return $package;
     }, $releases));
 }
开发者ID:AydinHassan,项目名称:magento-connect-composer-plugin,代码行数:28,代码来源:Plugin.php

示例13: bindPackageValues

 /**
  * @param string $newName
  * @param array $package
  * @return Package
  */
 protected static function bindPackageValues($newName, array $package)
 {
     $new = new Package($newName, $package['version'], $package['version']);
     $new->setType('dist');
     if (isset($package['bin'])) {
         $new->setBinaries($package['bin']);
     }
     if (isset($package['dist']['type'])) {
         $new->setDistType($package['dist']['type']);
     }
     if (isset($package['dist']['url'])) {
         $new->setDistUrl($package['dist']['url']);
     }
     if (isset($package['excludes'])) {
         $new->setArchiveExcludes($package['excludes']);
     }
     return $new;
 }
开发者ID:REZ1DENT3,项目名称:mystem,代码行数:23,代码来源:MystemBinaryInstaller.php

示例14: testGetMultipleWebrootPackagesException

 /**
  * testGetMultipleWebrootPackagesException
  * 
  * @return void
  * 
  * @expectedException \InvalidArgumentException
  */
 public function testGetMultipleWebrootPackagesException()
 {
     $installer = new WebrootInstaller($this->io, $this->composer);
     $package1 = new Package('fancyguy/webroot-package', '1.0.0', '1.0.0');
     $package1->setType('webroot');
     $package2 = new Package('fancyguy/another-webroot-package', '1.0.0', '1.0.0');
     $package2->setType('webroot');
     $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
     $this->composer->setPackage($consumerPackage);
     $consumerPackage->setExtra(array('webroot-dir' => 'content', 'webroot-package' => 'fancyguy/webroot-package'));
     $consumerPackage->setRequires(array($package1, $package2));
     $result1 = $installer->getInstallPath($package1);
     $result2 = $installer->getInstallPath($package2);
 }
开发者ID:fancyguy,项目名称:webroot-installer,代码行数:21,代码来源:WebrootInstallerTest.php

示例15: createCorePackage

 public function createCorePackage($name = 'magento/core-package')
 {
     $package = new Package($name, "1.0.0", $name);
     $package->setType('magento-core');
     return $package;
 }
开发者ID:robofirm,项目名称:magento-core-composer-installer,代码行数:6,代码来源:CoreManagerTest.php


注:本文中的Composer\Package\Package::setType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。