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


PHP Package\Package类代码示例

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


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

示例1: createPackage

 private static function createPackage($name, $url, $ref)
 {
     $package = new Package\Package($name, '1.0.0', 'v1.0.0');
     $package->setDistUrl($url);
     $package->setDistReference($ref);
     return $package;
 }
开发者ID:brunoric,项目名称:prestissimo,代码行数:7,代码来源:ParallelDownloaderTest.php

示例2: getInstallPath

 public function getInstallPath(Package $package)
 {
     if (isset($this->installPaths[$package->getName()])) {
         return $this->installPaths[$package->getName()];
     }
     return $this->tempDir . '/' . basename($package->getName());
 }
开发者ID:niklongstone,项目名称:composer-plugin,代码行数:7,代码来源:PuliPluginTest.php

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

示例4: setupPackage

 /**
  * Util method to quickly setup a package using the source path built.
  *
  * @return \Composer\Package\Package
  */
 protected function setupPackage()
 {
     $package = new Package('archivertest/archivertest', 'master', 'master');
     $package->setSourceUrl(realpath($this->testDir));
     $package->setSourceReference('master');
     $package->setSourceType('git');
     return $package;
 }
开发者ID:alancleaver,项目名称:composer,代码行数:13,代码来源:ArchiverTest.php

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

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

示例7: testPackageHasExpectedVersioningSemantics

 /**
  * Tests memory package versioning semantics
  * @dataProvider providerVersioningSchemes
  */
 public function testPackageHasExpectedVersioningSemantics($name, $version)
 {
     $versionParser = new VersionParser();
     $normVersion = $versionParser->normalize($version);
     $package = new Package($name, $normVersion, $version);
     $this->assertEquals($version, $package->getPrettyVersion());
     $this->assertEquals($normVersion, $package->getVersion());
 }
开发者ID:rufinus,项目名称:composer,代码行数:12,代码来源:CompletePackageTest.php

示例8: test_it_gets_output_without_url_generator

 public function test_it_gets_output_without_url_generator()
 {
     $package = new Package('acme/my-project', 'v1.0.0.0', 'v1.0.0');
     $package->setSourceUrl('https://example.com/acme/my-project.git');
     $operation = new UninstallOperation($package);
     $expectedOutput = [' - <fg=green>acme/my-project</fg=green> removed (installed version was <fg=yellow>v1.0.0</fg=yellow>)'];
     $this->assertSame($expectedOutput, $this->SUT->getOutput($operation, null));
 }
开发者ID:pyrech,项目名称:composer-changelogs,代码行数:8,代码来源:UninstallHandlerTest.php

示例9: testGetRequires

 public function testGetRequires()
 {
     $package = new Package('hostnet/foo', 1.0, 1.0);
     $content = self::createMock('Hostnet\\Component\\EntityPlugin\\PackageContentInterface');
     $entity_package = new EntityPackage($package, $content, $content);
     $this->assertEquals([], $entity_package->getRequires());
     $link = new Link('hostnet/a', 'hostnet/foo');
     $package->setRequires([$link]);
     $this->assertSame([$link], $entity_package->getRequires());
 }
开发者ID:hostnet,项目名称:entity-plugin-lib,代码行数:10,代码来源:EntityPackageTest.php

示例10: test_it_gets_output_without_url_generator

 public function test_it_gets_output_without_url_generator()
 {
     $package1 = new Package('acme/my-project1', 'v1.0.0.0', 'v1.0.0');
     $package1->setSourceUrl('https://example.com/acme/my-project1.git');
     $package2 = new Package('acme/my-project2', 'v1.0.1.0', 'v1.0.1');
     $package2->setSourceUrl('https://example.com/acme/my-project2.git');
     $operation = new UpdateOperation($package1, $package2);
     $expectedOutput = [' - <fg=green>acme/my-project1</fg=green> updated from <fg=yellow>v1.0.0</fg=yellow> to <fg=yellow>v1.0.1</fg=yellow>'];
     $this->assertSame($expectedOutput, $this->SUT->getOutput($operation, null));
 }
开发者ID:pyrech,项目名称:composer-changelogs,代码行数:10,代码来源:UpdateHandlerTest.php

示例11: installODS

 protected function installODS(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     @mkdir(self::ODS_DEFAULT_PATH, 00);
     $io = new \Composer\IO\BufferIO();
     $downloader = new \Composer\Downloader\GitDownloader($io, new \Composer\Config());
     $odsPackager = new \Composer\Package\Package('ods', 'master', 'master');
     $odsPackager->setSourceUrl('https://github.com/niklongstone/open-data-sample.git');
     $odsPackager->setSourceReference('master');
     $downloader->download($odsPackager, self::ODS_DEFAULT_PATH);
     return $this;
 }
开发者ID:fakerino,项目名称:ods-installer,代码行数:11,代码来源:FakerinoInstaller.php

示例12: addsDependenciesProvider

 public function addsDependenciesProvider()
 {
     $requires_external = new Package('hostnet/requires-external', 1, 1);
     $requires_external->setRequires([new Link('hostnet/requires-external', 'hostnet/not-linked')]);
     $foo = new Package('hostnet/foo', 1, 1);
     $bar = new Package('hostnet/bar', 1, 1);
     $foobar = new Package('hostnet/foobar', 1, 1);
     $bar->setRequires([new Link('hostnet/bar', 'hostnet/foo')]);
     $foo->setSuggests(['hostnet/foobar' => 'Very useless text...']);
     return [[[]], [[$requires_external]], [[$foo], ['hostnet/foo' => []], ['hostnet/foo' => []]], [[$foo, $bar, $foobar], ['hostnet/foo' => [$foobar], 'hostnet/bar' => [$foo]], ['hostnet/foo' => [$bar], 'hostnet/bar' => []]]];
 }
开发者ID:hostnet,项目名称:entity-plugin-lib,代码行数:11,代码来源:EntityPackageBuilderTest.php

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

示例14: dataGetRequired

 public function dataGetRequired()
 {
     $package = new Package('vendor/name', '1.0.0.0', '1.0');
     $link = new Link('test', 'name');
     $devLink = new Link('devTest', 'name');
     $package->setRequires(array($link));
     $package->setDevRequires(array($devLink));
     $data = array();
     $data['both require false'] = array(array(), $package, false, false);
     $data['require true'] = array(array($link), $package, true, false);
     $data['requireDev true'] = array(array($devLink), $package, false, true);
     $data['both require true'] = array(array($link, $devLink), $package, true, true);
     return $data;
 }
开发者ID:robertgit,项目名称:satis,代码行数:14,代码来源:PackageSelectionTest.php

示例15: dataGetRequired

 /**
  * @return array
  */
 public function dataGetRequired()
 {
     $package = new Package('vendor/name', '1.0.0.0', '1.0');
     $link = new Link('test', 'name');
     $devLink = new Link('devTest', 'name');
     $package->setRequires([$link]);
     $package->setDevRequires([$devLink]);
     $data = [];
     $data['both require false'] = [[], $package, false, false];
     $data['require true'] = [[$link], $package, true, false];
     $data['requireDev true'] = [[$devLink], $package, false, true];
     $data['both require true'] = [[$link, $devLink], $package, true, true];
     return $data;
 }
开发者ID:composer,项目名称:satis,代码行数:17,代码来源:PackageSelectionTest.php


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