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


PHP Composer\Composer类代码示例

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


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

示例1: activate

 /**
  * {@inheritdoc}
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     foreach (static::$types as $type) {
         $installer = new WordpressInstaller($io, $composer, $type);
         $composer->getInstallationManager()->addInstaller($installer);
     }
 }
开发者ID:rjelierse,项目名称:composer-plugin-wordpress,代码行数:10,代码来源:WordpressInstallerPlugin.php

示例2: activate

 public function activate(Composer $composer, IOInterface $io)
 {
     $this->io = $io;
     $vendor = $composer->getConfig()->get('vendor-dir', '/');
     $this->vendor = $vendor;
     $this->root = dirname($vendor);
 }
开发者ID:HRMsimon,项目名称:hhvm-autoload,代码行数:7,代码来源:ComposerPlugin.php

示例3: setUp

    public function setUp()
    {
        $this->config = $this->getMock('Composer\Config');
        $this->config->expects($this->any())
            ->method('get')
            ->will($this->returnCallback(function ($key) {
                switch ($key) {
                    case 'cache-repo-dir':
                        return sys_get_temp_dir() . '/composer-test-repo-cache';
                    case 'vendor-dir':
                        return sys_get_temp_dir() . '/composer-test/vendor';
                }

                return null;
            }));

        $this->rootPackage = $this->getMock('Composer\Package\RootPackageInterface');
        $this->package = $this->getMock('Composer\Package\PackageInterface');
        $this->package->expects($this->any())
            ->method('getName')
            ->will($this->returnValue('foo-asset/foo'));

        $this->composer = $this->getMock('Composer\Composer');
        $this->composer->expects($this->any())
            ->method('getPackage')
            ->will($this->returnValue($this->rootPackage));
        $this->composer->expects($this->any())
            ->method('getConfig')
            ->will($this->returnValue($this->config));
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:30,代码来源:IgnoreFactoryTest.php

示例4: testSetGetInstallationManager

 public function testSetGetInstallationManager()
 {
     $composer = new Composer();
     $manager = $this->getMock('Composer\\Installer\\InstallationManager');
     $composer->setInstallationManager($manager);
     $this->assertSame($manager, $composer->getInstallationManager());
 }
开发者ID:alancleaver,项目名称:composer,代码行数:7,代码来源:ComposerTest.php

示例5: activate

 /**
  * @param Composer $composer
  * @param IOInterface $io
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     $repositoryManager = $composer->getRepositoryManager();
     $extra = $composer->getPackage()->getExtra();
     if (!isset($extra['connect-packages'])) {
         return;
     }
     $versionParser = new VersionParser();
     $links = [];
     foreach ($extra['connect-packages'] as $connectPackage => $version) {
         try {
             $releases = $this->getVersionsForPackage($connectPackage);
         } catch (InvalidArgumentException $e) {
             $message = '<error>Could not find release manifest for module with extension key: "%s". ';
             $message .= 'Did you get the casing right? Error: "%s"</error>';
             $io->writeError(sprintf($message, $connectPackage, $e->getMessage()), true);
             continue;
         } catch (UnexpectedValueException $e) {
             $message = '<error>Non valid XML return from connect for module with extension key: "%s".</error>';
             $message .= $e->getMessage();
             $io->writeError(sprintf($message, $connectPackage), true);
             continue;
         }
         $repository = $this->addPackages($releases, $connectPackage);
         $repositoryManager->addRepository($repository);
         $constraint = $versionParser->parseConstraints($version);
         $links[] = new Link($composer->getPackage()->getName(), $connectPackage, $constraint);
     }
     if (!empty($links)) {
         $requires = $composer->getPackage()->getRequires();
         $requires = array_merge($requires, $links);
         $composer->getPackage()->setRequires($requires);
     }
 }
开发者ID:adam-paterson,项目名称:magento-connect-composer-plugin,代码行数:38,代码来源:Plugin.php

示例6: activate

 /**
  * {@inheritDoc}
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     $pluginInstaller = new PluginInstaller($io, $composer);
     $composer->getInstallationManager()->addInstaller($pluginInstaller);
     //$themeInstaller = new ThemeInstaller($io, $composer);
     //$composer->getInstallationManager()->addInstaller($themeInstaller);
 }
开发者ID:mage2,项目名称:plugin-installer,代码行数:10,代码来源:Mage2Plugin.php

示例7: testGetLocations

 /**
  * Test getLocations returning appropriate values based on CakePHP version
  *
  */
 public function testGetLocations()
 {
     $package = new RootPackage('CamelCased', '1.0', '1.0');
     $composer = new Composer();
     $rm = new RepositoryManager($this->getMock('Composer\\IO\\IOInterface'), $this->getMock('Composer\\Config'));
     $composer->setRepositoryManager($rm);
     $installer = new CakePHPInstaller($package, $composer);
     // 2.0 < cakephp < 3.0
     $this->setCakephpVersion($rm, '2.0.0');
     $result = $installer->getLocations();
     $this->assertContains('Plugin/', $result['plugin']);
     $this->setCakephpVersion($rm, '2.5.9');
     $result = $installer->getLocations();
     $this->assertContains('Plugin/', $result['plugin']);
     $this->setCakephpVersion($rm, '~2.5');
     $result = $installer->getLocations();
     $this->assertContains('Plugin/', $result['plugin']);
     // special handling for 2.x versions when 3.x is still in development
     $this->setCakephpVersion($rm, 'dev-master');
     $result = $installer->getLocations();
     $this->assertContains('Plugin/', $result['plugin']);
     $this->setCakephpVersion($rm, '>=2.5');
     $result = $installer->getLocations();
     $this->assertContains('Plugin/', $result['plugin']);
     // cakephp >= 3.0
     $this->setCakephpVersion($rm, '3.0.*-dev');
     $result = $installer->getLocations();
     $this->assertContains('plugins/', $result['plugin']);
     $this->setCakephpVersion($rm, '~8.8');
     $result = $installer->getLocations();
     $this->assertContains('plugins/', $result['plugin']);
 }
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:36,代码来源:CakePHPInstallerTest.php

示例8: activate

 public function activate(Composer $composer, IOInterface $io)
 {
     // Add the Innomatic legacy platform installer
     $composer->getInstallationManager()->addInstaller(new LegacyPlatformInstaller($io, $composer));
     // Add the Innomatic legacy application installer
     $composer->getInstallationManager()->addInstaller(new LegacyApplicationInstaller($io, $composer));
 }
开发者ID:innomatic,项目名称:innomatic-legacy-installer,代码行数:7,代码来源:InstallerPlugin.php

示例9: __construct

 /**
  * @param \Composer\Composer $composer
  * @param \Composer\Util\Filesystem $filesystem
  */
 public function __construct(\Composer\Composer $composer, \Composer\Util\Filesystem $filesystem = NULL)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->filesystem = $filesystem ?: new \Composer\Util\Filesystem();
     $this->extensionDir = self::TYPO3_CONF_DIR . DIRECTORY_SEPARATOR . self::TYPO3_EXT_DIR;
 }
开发者ID:AOEpeople,项目名称:CmsComposerInstallers,代码行数:11,代码来源:ExtensionInstaller.php

示例10: createComposerInstance

 private function createComposerInstance()
 {
     $composer = new Composer();
     $config = new Config();
     $composer->setConfig($config);
     return $composer;
 }
开发者ID:detain,项目名称:composer,代码行数:7,代码来源:RunScriptCommandTest.php

示例11: getPackageInstallPath

 public static function getPackageInstallPath(PackageInterface $package, Composer $composer)
 {
     $prettyName = $package->getPrettyName();
     if (strpos($prettyName, '/') !== false) {
         list($vendor, $name) = explode('/', $prettyName);
     } else {
         $vendor = '';
         $name = $prettyName;
     }
     $availableVars = compact('name', 'vendor');
     $extra = $package->getExtra();
     if (!empty($extra['installer-name'])) {
         $availableVars['name'] = $extra['installer-name'];
     }
     if ($composer->getPackage()) {
         $extra = $composer->getPackage()->getExtra();
         if (!empty($extra['installer-paths'])) {
             $customPath = self::mapCustomInstallPaths($extra['installer-paths'], $prettyName);
             if (false !== $customPath) {
                 return self::templatePath($customPath, $availableVars);
             }
         }
     }
     return NULL;
 }
开发者ID:mnsami,项目名称:composer-custom-directory-installer,代码行数:25,代码来源:PackageUtils.php

示例12: callRecursive

 /**
  * Call extra recursive
  * @param Composer $composer
  * @param IExtra $extra
  */
 private function callRecursive(Composer $composer, IExtra $extra)
 {
     $extra->run($composer->getPackage(), true);
     foreach ($composer->getRepositoryManager()->getLocalRepository()->getPackages() as $package) {
         $extra->run($package, false);
     }
 }
开发者ID:pipaslot,项目名称:modules,代码行数:12,代码来源:Extra.php

示例13: activate

 public function activate(Composer $composer, IO\IOInterface $io)
 {
     $this->composer = $composer;
     $this->config = $composer->getConfig();
     $this->io = $io;
     $this->pluginConfig = $this->setPluginConfig();
 }
开发者ID:harimau99,项目名称:prestissimo,代码行数:7,代码来源:Plugin.php

示例14: getConsoleCommands

 public static function getConsoleCommands(Composer $composer)
 {
     $commands = array(array('yiic', 'migrate'));
     if ($composer->getPackage()) {
         $extra = $composer->getPackage()->getExtra();
         if (!empty($extra['yiicomposer-console-commands'])) {
             $tmp = $extra['yiicomposer-console-commands'];
         }
         if (!empty($tmp)) {
             $commands = array();
             foreach ($tmp as $c) {
                 $command = array();
                 $command[] = 'yiic';
                 $command[] = $c['controller'];
                 if (!empty($c['action'])) {
                     $command[] = $c['action'];
                 }
                 if (!empty($c['params'])) {
                     $command = array_merge($command, $c['params']);
                 }
                 if (!empty($c['params'])) {
                     foreach ($c['params'] as $k => $v) {
                         $command[] = '--' . $k . '=' . $v;
                     }
                 }
                 $commands[] = $command;
             }
         }
     }
     return $commands;
 }
开发者ID:mihaildev,项目名称:yiicomposer,代码行数:31,代码来源:Console.php

示例15: __construct

 public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
 {
     if (null === $package) {
         $package = $composer->getPackage();
     }
     $extraOxidRoot = $extraModuleVendor = false;
     if (null !== $package) {
         $extra = $package->getExtra();
         if (isset($extra['oxid-root'])) {
             foreach ($this->locations as $name => $location) {
                 $this->locations[$name] = "{$extra['oxid-root']}/{$location}";
             }
             $extraOxidRoot = true;
         }
         if (isset($extra['module-vendor'])) {
             $this->locations['module'] = str_replace('modules/', "modules/{$extra['module-vendor']}/", $this->locations['module']);
             $extraModuleVendor = true;
         }
     }
     $composerPackage = $composer->getPackage();
     if (null !== $composerPackage) {
         $extra = $composerPackage->getExtra();
         if (isset($extra['oxid-root']) && !$extraOxidRoot) {
             foreach ($this->locations as $name => $location) {
                 $this->locations[$name] = "{$extra['oxid-root']}/{$location}";
             }
         }
         if (isset($extra['module-vendor']) && !$extraModuleVendor) {
             $this->locations['module'] = str_replace('modules/', "modules/{$extra['module-vendor']}/", $this->locations['module']);
         }
     }
     parent::__construct($package, $composer, $io);
 }
开发者ID:kyoya-de,项目名称:installers,代码行数:33,代码来源:OxidInstaller.php


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