當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。