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


PHP ArrayRepository::__construct方法代码示例

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


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

示例1: __construct

 public function __construct(array $packages = array(), array $overrides = array())
 {
     foreach ($overrides as $name => $version) {
         $this->overrides[strtolower($name)] = array('name' => $name, 'version' => $version);
     }
     parent::__construct($packages);
 }
开发者ID:alcaeus,项目名称:composer,代码行数:7,代码来源:PlatformRepository.php

示例2: __construct

 /**
  * Initializes filesystem repository.
  *
  * @param array $config package definition
  */
 public function __construct(array $config)
 {
     parent::__construct();
     $this->config = $config['package'];
     // make sure we have an array of package definitions
     if (!is_numeric(key($this->config))) {
         $this->config = array($this->config);
     }
 }
开发者ID:neon64,项目名称:composer,代码行数:14,代码来源:PackageRepository.php

示例3: __construct

 /**
  * Initializes path repository.
  *
  * @param array $repoConfig
  * @param IOInterface $io
  * @param Config $config
  */
 public function __construct(array $repoConfig, IOInterface $io, Config $config)
 {
     if (!isset($repoConfig['url'])) {
         throw new \RuntimeException('You must specify the `url` configuration for the path repository');
     }
     $this->loader = new ArrayLoader();
     $this->url = $repoConfig['url'];
     $this->process = new ProcessExecutor($io);
     $this->versionGuesser = new VersionGuesser($config, $this->process, new VersionParser());
     parent::__construct();
 }
开发者ID:4ung,项目名称:composer,代码行数:18,代码来源:PathRepository.php

示例4: __construct

 public function __construct(array $repoConfig, IOInterface $io)
 {
     parent::__construct();
     if (!extension_loaded('zip')) {
         throw new \RuntimeException('The artifact repository requires PHP\'s zip extension');
     }
     $this->loader = new ArrayLoader();
     $this->lookup = $repoConfig['url'];
     $this->io = $io;
     $this->repoConfig = $repoConfig;
 }
开发者ID:radykal-com,项目名称:composer,代码行数:11,代码来源:ArtifactRepository.php

示例5: __construct

 public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
 {
     parent::__construct();
     $this->drivers = $drivers ?: array('github' => 'Composer\\Repository\\Vcs\\GitHubDriver', 'gitlab' => 'Composer\\Repository\\Vcs\\GitLabDriver', 'git-bitbucket' => 'Composer\\Repository\\Vcs\\GitBitbucketDriver', 'git' => 'Composer\\Repository\\Vcs\\GitDriver', 'hg-bitbucket' => 'Composer\\Repository\\Vcs\\HgBitbucketDriver', 'hg' => 'Composer\\Repository\\Vcs\\HgDriver', 'perforce' => 'Composer\\Repository\\Vcs\\PerforceDriver', 'fossil' => 'Composer\\Repository\\Vcs\\FossilDriver', 'svn' => 'Composer\\Repository\\Vcs\\SvnDriver');
     $this->url = $repoConfig['url'];
     $this->io = $io;
     $this->type = isset($repoConfig['type']) ? $repoConfig['type'] : 'vcs';
     $this->verbose = $io->isVeryVerbose();
     $this->config = $config;
     $this->repoConfig = $repoConfig;
 }
开发者ID:neon64,项目名称:composer,代码行数:11,代码来源:VcsRepository.php

示例6: __construct

 public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, RemoteFilesystem $rfs = null)
 {
     parent::__construct();
     if (!preg_match('{^https?://}', $repoConfig['url'])) {
         $repoConfig['url'] = 'http://' . $repoConfig['url'];
     }
     $urlBits = parse_url($repoConfig['url']);
     if (empty($urlBits['scheme']) || empty($urlBits['host'])) {
         throw new \UnexpectedValueException('Invalid url given for PEAR repository: ' . $repoConfig['url']);
     }
     $this->url = rtrim($repoConfig['url'], '/');
     $this->io = $io;
     $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $config);
     $this->vendorAlias = isset($repoConfig['vendor-alias']) ? $repoConfig['vendor-alias'] : null;
     $this->versionParser = new VersionParser();
     $this->repoConfig = $repoConfig;
 }
开发者ID:neon64,项目名称:composer,代码行数:17,代码来源:PearRepository.php

示例7: __construct

 public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
 {
     parent::__construct();
     if (!preg_match('{^[\\w.]+\\??://}', $repoConfig['url'])) {
         // assume http as the default protocol
         $repoConfig['url'] = 'http://' . $repoConfig['url'];
     }
     $repoConfig['url'] = rtrim($repoConfig['url'], '/');
     if ('https?' === substr($repoConfig['url'], 0, 6)) {
         $repoConfig['url'] = (extension_loaded('openssl') ? 'https' : 'http') . substr($repoConfig['url'], 6);
     }
     $urlBits = parse_url($repoConfig['url']);
     if ($urlBits === false || empty($urlBits['scheme'])) {
         throw new \UnexpectedValueException('Invalid url given for Composer repository: ' . $repoConfig['url']);
     }
     if (!isset($repoConfig['options'])) {
         $repoConfig['options'] = array();
     }
     if (isset($repoConfig['allow_ssl_downgrade']) && true === $repoConfig['allow_ssl_downgrade']) {
         $this->allowSslDowngrade = true;
     }
     $this->config = $config;
     $this->options = $repoConfig['options'];
     $this->url = $repoConfig['url'];
     $this->baseUrl = rtrim(preg_replace('{(?:/[^/\\\\]+\\.json)?(?:[?#].*)?$}', '', $this->url), '/');
     $this->io = $io;
     $this->cache = new Cache($io, $config->get('cache-repo-dir') . '/' . preg_replace('{[^a-z0-9.]}i', '-', $this->url), 'a-z0-9.$');
     $this->loader = new ArrayLoader();
     if ($rfs && $this->options) {
         $rfs = clone $rfs;
         $rfs->setOptions($this->options);
     }
     $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $this->config, $this->options);
     $this->eventDispatcher = $eventDispatcher;
     $this->repoConfig = $repoConfig;
 }
开发者ID:detain,项目名称:composer,代码行数:36,代码来源:ComposerRepository.php


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