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


PHP Composer::getDownloadManager方法代码示例

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


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

示例1: __construct

 /**
  * Initializes library installer.
  *
  * @param IOInterface $io
  * @param Composer    $composer
  * @param Filesystem  $filesystem
  */
 public function __construct(IOInterface $io, Composer $composer, Filesystem $filesystem = null)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->io = $io;
     $this->filesystem = $filesystem ?: new Filesystem();
 }
开发者ID:claromentis,项目名称:installer-composer-plugin,代码行数:14,代码来源:BaseInstaller.php

示例2: testSetGetDownloadManager

 public function testSetGetDownloadManager()
 {
     $composer = new Composer();
     $manager = $this->getMock('Composer\\Downloader\\DownloadManager');
     $composer->setDownloadManager($manager);
     $this->assertSame($manager, $composer->getDownloadManager());
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:7,代码来源:ComposerTest.php

示例3: updateComposer

 /**
  * @param bool $reload
  *
  * @return int
  */
 protected function updateComposer($reload = false)
 {
     if ($reload) {
         $this->composer = Factory::create($this->io, null, $this->disablePluginsByDefault);
     }
     ini_set('memory_limit', '1024M');
     $this->composer->getDownloadManager()->setOutputProgress(true);
     $install = Installer::create($this->io, $this->composer);
     $config = $this->composer->getConfig();
     $preferSource = false;
     $preferDist = true;
     switch ($config->get('preferred-install')) {
         case 'source':
             $preferSource = true;
             break;
         case 'dist':
             $preferDist = true;
             break;
         case 'auto':
         default:
             break;
     }
     $optimize = $config->get('optimize-autoloader');
     $authoritative = $config->get('classmap-authoritative');
     $install->setPreferSource($preferSource);
     $install->setPreferDist($preferDist);
     $install->setDevMode(true);
     $install->setDumpAutoloader(true);
     $install->setOptimizeAutoloader(true);
     $install->setUpdate(true);
     return $install->run();
 }
开发者ID:notadd,项目名称:framework,代码行数:37,代码来源:Command.php

示例4: activate

 /**
  * @inheritdoc
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     $this->io = $io;
     //Extend download manager
     $dm = $composer->getDownloadManager();
     $executor = new ProcessExecutor($io);
     $fs = new Filesystem($executor);
     $config = $composer->getConfig();
     $dm->setDownloader('svn-export', new Downloader($io, $config, $executor, $fs));
     //Extend RepositoryManager Classes
     $rm = $composer->getRepositoryManager();
     $rm->setRepositoryClass('svn-export', 'LinearSoft\\Composer\\SvnExport\\Repository\\VcsRepository');
     $rm->setRepositoryClass('svn-export-composer', 'LinearSoft\\Composer\\SvnExport\\Repository\\ComposerRepository');
     //Load Extra Data
     $extra = $composer->getPackage()->getExtra();
     if (isset($extra['svn-export-repositories']) && is_array($extra['svn-export-repositories'])) {
         foreach ($extra['svn-export-repositories'] as $index => $repoConfig) {
             $this->validateRepositories($index, $repoConfig);
             if (isset($repoConfig['name'])) {
                 $name = $repoConfig['name'];
             } else {
                 $name = is_int($index) ? preg_replace('{^https?://}i', '', $repoConfig['url']) : $index;
             }
             if ($repoConfig['type'] === 'svn') {
                 $repoConfig['type'] = 'svn-export';
             } else {
                 $repoConfig['type'] = 'svn-export-composer';
             }
             $repo = $rm->createRepository($repoConfig['type'], $repoConfig);
             $rm->addRepository($repo);
             $this->io->write("Added SvnExport repo: {$name}");
         }
     }
 }
开发者ID:linearsoft,项目名称:composer-svn-export,代码行数:37,代码来源:Plugin.php

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

示例6: __construct

 /**
  * @param \Composer\Composer $composer
  * @param Filesystem $filesystem
  */
 public function __construct(\Composer\Composer $composer, Filesystem $filesystem, CoreInstaller\GetTypo3OrgService $getTypo3OrgService)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->filesystem = $filesystem;
     $this->getTypo3OrgService = $getTypo3OrgService;
     $this->symlinks = array(self::TYPO3_SRC_DIR . DIRECTORY_SEPARATOR . self::TYPO3_INDEX_PHP => self::TYPO3_INDEX_PHP, self::TYPO3_SRC_DIR . DIRECTORY_SEPARATOR . self::TYPO3_DIR => self::TYPO3_DIR);
 }
开发者ID:AOEpeople,项目名称:CmsComposerInstallers,代码行数:12,代码来源:CoreInstaller.php

示例7: __construct

 /**
  * @param \Composer\Composer $composer
  * @param Filesystem $filesystem
  */
 public function __construct(\Composer\Composer $composer, Filesystem $filesystem)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->filesystem = $filesystem;
     $this->initializeConfiguration();
     $this->initializeSymlinks();
 }
开发者ID:sup7even,项目名称:TYPO3-schulung-Distribution,代码行数:12,代码来源:CoreInstaller.php

示例8: __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->initializeConfiguration();
     $this->initializeExtensionDir();
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:12,代码来源:ExtensionInstaller.php

示例9: testSetGetDownloadManager

 public function testSetGetDownloadManager()
 {
     $composer = new Composer();
     $io = $this->getMock('Composer\\IO\\IOInterface');
     $manager = $this->getMock('Composer\\Downloader\\DownloadManager', array(), array($io));
     $composer->setDownloadManager($manager);
     $this->assertSame($manager, $composer->getDownloadManager());
 }
开发者ID:alancleaver,项目名称:composer,代码行数:8,代码来源:ComposerTest.php

示例10: __construct

 /**
  * @param \Composer\Composer $composer
  * @param Filesystem $filesystem
  */
 public function __construct(\Composer\Composer $composer, Filesystem $filesystem, CoreInstaller\GetTypo3OrgService $getTypo3OrgService)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->filesystem = $filesystem;
     $this->getTypo3OrgService = $getTypo3OrgService;
     $this->initializeConfiguration();
     $this->initializeSymlinks();
 }
开发者ID:rengaw83,项目名称:CmsComposerInstallers,代码行数:13,代码来源:CoreInstaller.php

示例11: initMultiVcsRepositories

 /**
  * Init multi VCS repository
  *
  * @param Composer    $composer
  * @param IOInterface $io
  * @return $this
  */
 protected function initMultiVcsRepositories(Composer $composer, IOInterface $io)
 {
     $repoDownloader = new GitMultiRepoDownloader($io, $composer->getConfig());
     foreach ($this->getVcsTypes() as $type) {
         $composer->getDownloadManager()->setDownloader($type, $repoDownloader);
         $composer->getRepositoryManager()->setRepositoryClass($type, $this->getMultiRepositoryClassName());
     }
     return $this;
 }
开发者ID:andkirby,项目名称:multi-repo-composer,代码行数:16,代码来源:MultiRepoPlugin.php

示例12: __construct

 /**
  * Initializes library installer.
  *
  * @param IOInterface          $io
  * @param Composer             $composer
  * @param string               $type
  * @param Filesystem           $filesystem
  * @param BinaryInstaller      $binaryInstaller
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null, BinaryInstaller $binaryInstaller = null)
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->io = $io;
     $this->type = $type;
     $this->filesystem = $filesystem ?: new Filesystem();
     $this->vendorDir = rtrim($composer->getConfig()->get('vendor-dir'), '/');
     $this->binaryInstaller = $binaryInstaller ?: new BinaryInstaller($this->io, rtrim($composer->getConfig()->get('bin-dir'), '/'), $composer->getConfig()->get('bin-compat'), $this->filesystem);
 }
开发者ID:radykal-com,项目名称:composer,代码行数:19,代码来源:LibraryInstaller.php

示例13: __construct

 /**
  * Initializes library installer.
  *
  * @param IOInterface $io
  * @param Composer    $composer
  * @param string      $type
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library')
 {
     $this->composer = $composer;
     $this->downloadManager = $composer->getDownloadManager();
     $this->io = $io;
     $this->type = $type;
     $this->filesystem = new Filesystem();
     $this->vendorDir = rtrim($composer->getConfig()->get('vendor-dir'), '/');
     $this->binDir = rtrim($composer->getConfig()->get('bin-dir'), '/');
 }
开发者ID:nickelc,项目名称:composer,代码行数:17,代码来源:LibraryInstaller.php

示例14: activate

 /**
  * @param Composer    $composer
  * @param IOInterface $io
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     $dm = $composer->getDownloadManager();
     // yes, it is bad
     $r = new \ReflectionObject($dm);
     $property = $r->getProperty('downloaders');
     $property->setAccessible(true);
     $downloaders = $property->getValue($dm);
     $downloaders['git'] = new \Sonata\Composer\Downloader\GitDownloader($io, $composer->getConfig());
     $property->setValue($dm, $downloaders);
 }
开发者ID:sonata-project,项目名称:sonata-composer,代码行数:15,代码来源:MissingSCMPlugin.php

示例15: activate

 /**
  * {@inheritDoc}
  */
 public function activate(Composer $composer, IOInterface $io)
 {
     $filesystem = new Filesystem();
     $composer->getInstallationManager()->addInstaller(new CoreInstaller($composer, $filesystem, new CoreInstaller\GetTypo3OrgService($io)));
     $composer->getInstallationManager()->addInstaller(new ExtensionInstaller($composer, $filesystem));
     $cache = null;
     if ($composer->getConfig()->get('cache-files-ttl') > 0) {
         $cache = new Cache($io, $composer->getConfig()->get('cache-files-dir'), 'a-z0-9_./');
     }
     $composer->getDownloadManager()->setDownloader('t3x', new Downloader\T3xDownloader($io, $composer->getConfig(), null, $cache));
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:14,代码来源:Plugin.php


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