• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Composer\Factory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: preUpdate

 /**
  * Merge repositories and requirements from a separate composer-local.json.
  *
  * This allows static development dependencies to be shipped with Vanilla, but can be customized with a
  * composer-local.json file that specifies additional dependencies such as plugins or compatibility libraries.
  *
  * @param Event $event The event being fired.
  */
 public static function preUpdate(Event $event)
 {
     self::clearAddonManagerCache();
     // Check for a composer-local.json.
     $composerLocalPath = './composer-local.json';
     if (!file_exists($composerLocalPath)) {
         return;
     }
     $composer = $event->getComposer();
     $factory = new Factory();
     $localComposer = $factory->createComposer($event->getIO(), $composerLocalPath, true, null, false);
     // Merge repositories.
     $localRepositories = $localComposer->getRepositoryManager()->getRepositories();
     foreach ($localRepositories as $repository) {
         /* @var \Composer\Repository\RepositoryInterface $repository */
         if (method_exists($repository, 'getRepoConfig')) {
             $config = $repository->getRepoConfig();
         } else {
             $config = ['url' => ''];
         }
         // Skip the packagist repo.
         if (strpos($config['url'], 'packagist.org') !== false) {
             continue;
         }
         $composer->getRepositoryManager()->addRepository($repository);
     }
     // Merge requirements.
     $requires = array_merge($composer->getPackage()->getRequires(), $localComposer->getPackage()->getRequires());
     $composer->getPackage()->setRequires($requires);
     $devRequires = array_merge($composer->getPackage()->getDevRequires(), $localComposer->getPackage()->getDevRequires());
     $composer->getPackage()->setDevRequires($devRequires);
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:40,代码来源:ComposerHelper.php


示例2: dump

 /**
  * Builds the archives of the repository.
  *
  * @param array $packages List of packages to dump
  */
 public function dump(array $packages)
 {
     $helper = new ArchiveBuilderHelper($this->output, $this->config['archive']);
     $directory = $helper->getDirectory($this->outputDir);
     $this->output->writeln(sprintf("<info>Creating local downloads in '%s'</info>", $directory));
     $format = isset($this->config['archive']['format']) ? $this->config['archive']['format'] : 'zip';
     $endpoint = isset($this->config['archive']['prefix-url']) ? $this->config['archive']['prefix-url'] : $this->config['homepage'];
     $includeArchiveChecksum = isset($this->config['archive']['checksum']) ? (bool) $this->config['archive']['checksum'] : true;
     $composerConfig = Factory::createConfig();
     $factory = new Factory();
     $io = new ConsoleIO($this->input, $this->output, $this->helperSet);
     $io->loadConfiguration($composerConfig);
     /* @var \Composer\Downloader\DownloadManager $downloadManager */
     $downloadManager = $factory->createDownloadManager($io, $composerConfig);
     /* @var \Composer\Package\Archiver\ArchiveManager $archiveManager */
     $archiveManager = $factory->createArchiveManager($composerConfig, $downloadManager);
     $archiveManager->setOverwriteFiles(false);
     shuffle($packages);
     /* @var \Composer\Package\CompletePackage $package */
     foreach ($packages as $package) {
         if ($helper->isSkippable($package)) {
             continue;
         }
         $this->output->writeln(sprintf("<info>Dumping '%s'.</info>", $package->getName()));
         try {
             if ('pear-library' === $package->getType()) {
                 // PEAR packages are archives already
                 $filesystem = new Filesystem();
                 $packageName = $archiveManager->getPackageFilename($package);
                 $path = realpath($directory) . '/' . $packageName . '.' . pathinfo($package->getDistUrl(), PATHINFO_EXTENSION);
                 if (!file_exists($path)) {
                     $downloadDir = sys_get_temp_dir() . '/composer_archiver/' . $packageName;
                     $filesystem->ensureDirectoryExists($downloadDir);
                     $downloadManager->download($package, $downloadDir, false);
                     $filesystem->ensureDirectoryExists($directory);
                     $filesystem->rename($downloadDir . '/' . pathinfo($package->getDistUrl(), PATHINFO_BASENAME), $path);
                     $filesystem->removeDirectory($downloadDir);
                 }
                 // Set archive format to `file` to tell composer to download it as is
                 $archiveFormat = 'file';
             } else {
                 $path = $archiveManager->archive($package, $format, $directory);
                 $archiveFormat = $format;
             }
             $archive = basename($path);
             $distUrl = sprintf('%s/%s/%s', $endpoint, $this->config['archive']['directory'], $archive);
             $package->setDistType($archiveFormat);
             $package->setDistUrl($distUrl);
             if ($includeArchiveChecksum) {
                 $package->setDistSha1Checksum(hash_file('sha1', $path));
             }
             $package->setDistReference($package->getSourceReference());
         } catch (\Exception $exception) {
             if (!$this->skipErrors) {
                 throw $exception;
             }
             $this->output->writeln(sprintf("<error>Skipping Exception '%s'.</error>", $exception->getMessage()));
         }
     }
 }
开发者ID:robertgit,项目名称:satis,代码行数:65,代码来源:ArchiveBuilder.php


示例3: testInjectCoreBundles

 /**
  * Test that the core bundles get correctly injected.
  *
  * @return void
  */
 public function testInjectCoreBundles()
 {
     $inOut = $this->getMock('Composer\\IO\\IOInterface');
     $factory = new Factory();
     $composer = $factory->createComposer($inOut, $this->config);
     $plugin = new Plugin();
     $local = $composer->getRepositoryManager()->getLocalRepository();
     if ($core = $local->findPackages('contao/core')) {
         $this->fail('Contao core has already been injected, found version ' . $core[0]->getVersion());
     }
     $plugin->activate($composer, $inOut);
     if (!($core = $local->findPackages('contao/core'))) {
         $this->fail('Contao core has not been injected.');
     }
     $core = $core[0];
     $constraint = new Constraint('=', $core->getVersion());
     $pool = new Pool('dev');
     $pool->addRepository($local);
     $this->assertNotNull($core = $pool->whatProvides('contao/core', $constraint));
     // bundle names + 'contao-community-alliance/composer-client'
     $this->assertCount(8, $core[0]->getRequires());
     foreach (array('contao/calendar-bundle', 'contao/comments-bundle', 'contao/core-bundle', 'contao/faq-bundle', 'contao/listing-bundle', 'contao/news-bundle', 'contao/newsletter-bundle') as $bundleName) {
         $this->assertNotNull($matches = $pool->whatProvides($bundleName, $constraint));
         $this->assertCount(1, $matches);
         $this->assertEquals('metapackage', $matches[0]->getType());
     }
 }
开发者ID:Jobu,项目名称:core,代码行数:32,代码来源:InjectCoreBundlesTest.php


示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $factory = new Factory();
     $file = $factory->getComposerFile();
     if (!file_exists($file)) {
         $output->writeln('<error>' . $file . ' not found.</error>');
         return 1;
     }
     if (!is_readable($file)) {
         $output->writeln('<error>' . $file . ' is not readable.</error>');
         return 1;
     }
     $dialog = $this->getHelperSet()->get('dialog');
     $json = new JsonFile($file);
     $composer = $json->read();
     $requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'));
     $requireKey = $input->getOption('dev') ? 'require-dev' : 'require';
     $baseRequirements = array_key_exists($requireKey, $composer) ? $composer[$requireKey] : array();
     $requirements = $this->formatRequirements($requirements);
     if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey)) {
         foreach ($requirements as $package => $version) {
             $baseRequirements[$package] = $version;
         }
         $composer[$requireKey] = $baseRequirements;
         $json->write($composer);
     }
     $output->writeln('<info>' . $file . ' has been updated</info>');
     // Update packages
     $composer = $this->getComposer();
     $io = $this->getIO();
     $install = Installer::create($io, $composer);
     $install->setVerbose($input->getOption('verbose'))->setPreferSource($input->getOption('prefer-source'))->setDevMode($input->getOption('dev'))->setUpdate(true)->setUpdateWhitelist($requirements);
     return $install->run() ? 0 : 1;
 }
开发者ID:nicodmf,项目名称:composer,代码行数:34,代码来源:RequireCommand.php


示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $factory = new Factory();
     $this->manager = $factory->createArchiveManager($factory->createConfig());
     $this->targetDir = $this->testDir . '/composer_archiver_tests';
 }
开发者ID:alancleaver,项目名称:composer,代码行数:7,代码来源:ArchiveManagerTest.php


示例6: getComposer

 /**
  * @return Composer
  */
 protected function getComposer()
 {
     $dir = Module::getRootDir();
     $path = $dir . '/composer.json';
     \Dotenv::setEnvironmentVariable('COMPOSER', $path);
     $factory = new Factory();
     return $factory->createComposer(new NullIO(), $path, false, $dir);
 }
开发者ID:NullRefExcep,项目名称:yii2-core,代码行数:11,代码来源:ComposerController.php


示例7: getComposer

 /**
  * @return \Composer\Composer
  */
 public static function getComposer()
 {
     if (!self::$composer) {
         $factory = new Factory();
         self::$composer = $factory->createComposer(new NullIO(), Yii::getAlias(self::$composerConfigFile), false, Yii::getAlias(self::$composerConfigFilePath));
     }
     return self::$composer;
 }
开发者ID:bookin,项目名称:yii2-composer-web,代码行数:11,代码来源:ComposerComponent.php


示例8: testIssue30LoadHousekeeper

 /**
  * When the plugin is loaded, the event listeners are registered which require the Housekeeper.
  *
  * When the plugin gets uninstalled the housekeeper does not exist anymore and a "Housekeeper class not found" is
  * thrown.
  *
  * Test for https://github.com/contao-community-alliance/composer-plugin/issues/30
  *
  * Situation:
  *  - plugin is installed.
  *  - plugin get uninstalled.
  *
  * Result:
  *  - Housekeeper class not found.
  *
  * @return void
  */
 public function testIssue30LoadHousekeeper()
 {
     $inOut = $this->getMock('Composer\\IO\\IOInterface');
     $factory = new Factory();
     $composer = $factory->createComposer($inOut);
     $plugin = new Plugin();
     $plugin->activate($composer, $inOut);
     $this->assertTrue(class_exists('ContaoCommunityAlliance\\Composer\\Plugin\\Housekeeper', false));
 }
开发者ID:Jobu,项目名称:core,代码行数:26,代码来源:IssuesTest.php


示例9: getDownloadManager

 private function getDownloadManager()
 {
     if (!$this->downloadManager) {
         $config = Factory::createConfig();
         $factory = new Factory();
         $this->downloadManager = $factory->createDownloadManager($this->getIO(), $config);
     }
     return $this->downloadManager;
 }
开发者ID:stof,项目名称:packanalyst,代码行数:9,代码来源:RunCommand.php


示例10: directories

 /**
  * Returns a list of directory paths in which scaffold files
  * are to be searched for, in order to build an index
  *
  * @return string[]
  */
 public function directories()
 {
     $composerConfig = Factory::createConfig(null, getcwd());
     $vendorDir = $composerConfig->get('vendor-dir');
     $globalVendorDir = Factory::createConfig(null, $composerConfig->get('home'))->get('vendor-dir');
     return [$globalVendorDir, $vendorDir, getcwd() . DIRECTORY_SEPARATOR];
 }
开发者ID:aedart,项目名称:scaffold,代码行数:13,代码来源:DirectoriesToIndex.php


示例11: initialize

 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     if ($input->getOption('global') && 'composer.json' !== $input->getOption('file')) {
         throw new \RuntimeException('--file and --global can not be combined');
     }
     $this->config = Factory::createConfig($this->getIO());
     $configFile = $input->getOption('global') ? $this->config->get('home') . '/config.json' : $input->getOption('file');
     $this->configFile = new JsonFile($configFile);
     $this->configSource = new JsonConfigSource($this->configFile);
     $authConfigFile = $input->getOption('global') ? $this->config->get('home') . '/auth.json' : dirname(realpath($input->getOption('file'))) . '/auth.json';
     $this->authConfigFile = new JsonFile($authConfigFile);
     $this->authConfigSource = new JsonConfigSource($this->authConfigFile, true);
     if ($input->getOption('global') && !$this->configFile->exists()) {
         touch($this->configFile->getPath());
         $this->configFile->write(array('config' => new \ArrayObject()));
         @chmod($this->configFile->getPath(), 0600);
     }
     if ($input->getOption('global') && !$this->authConfigFile->exists()) {
         touch($this->authConfigFile->getPath());
         $this->authConfigFile->write(array('http-basic' => new \ArrayObject(), 'github-oauth' => new \ArrayObject()));
         @chmod($this->authConfigFile->getPath(), 0600);
     }
     if (!$this->configFile->exists()) {
         throw new \RuntimeException(sprintf('File "%s" cannot be found in the current directory', $configFile));
     }
 }
开发者ID:VicDeo,项目名称:poc,代码行数:27,代码来源:ConfigCommand.php


示例12: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $baseUrl = (extension_loaded('openssl') ? 'https' : 'http') . '://' . self::HOMEPAGE;
     $config = Factory::createConfig();
     $remoteFilesystem = new RemoteFilesystem($this->getIO(), $config);
     $cacheDir = $config->get('cache-dir');
     $rollbackDir = $config->get('home');
     $localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
     // check if current dir is writable and if not try the cache dir from settings
     $tmpDir = is_writable(dirname($localFilename)) ? dirname($localFilename) : $cacheDir;
     // check for permissions in local filesystem before start connection process
     if (!is_writable($tmpDir)) {
         throw new FilesystemException('Composer update failed: the "' . $tmpDir . '" directory used to download the temp file could not be written');
     }
     if (!is_writable($localFilename)) {
         throw new FilesystemException('Composer update failed: the "' . $localFilename . '" file could not be written');
     }
     if ($input->getOption('rollback')) {
         return $this->rollback($output, $rollbackDir, $localFilename);
     }
     $latestVersion = trim($remoteFilesystem->getContents(self::HOMEPAGE, $baseUrl . '/version', false));
     $updateVersion = $input->getArgument('version') ?: $latestVersion;
     if (preg_match('{^[0-9a-f]{40}$}', $updateVersion) && $updateVersion !== $latestVersion) {
         $output->writeln('<error>You can not update to a specific SHA-1 as those phars are not available for download</error>');
         return 1;
     }
     if (Composer::VERSION === $updateVersion) {
         $output->writeln('<info>You are already using composer version ' . $updateVersion . '.</info>');
         return 0;
     }
     $tempFilename = $tmpDir . '/' . basename($localFilename, '.phar') . '-temp.phar';
     $backupFile = sprintf('%s/%s-%s%s', $rollbackDir, strtr(Composer::RELEASE_DATE, ' :', '_-'), preg_replace('{^([0-9a-f]{7})[0-9a-f]{33}$}', '$1', Composer::VERSION), self::OLD_INSTALL_EXT);
     $output->writeln(sprintf("Updating to version <info>%s</info>.", $updateVersion));
     $remoteFilename = $baseUrl . (preg_match('{^[0-9a-f]{40}$}', $updateVersion) ? '/composer.phar' : "/download/{$updateVersion}/composer.phar");
     $remoteFilesystem->copy(self::HOMEPAGE, $remoteFilename, $tempFilename);
     if (!file_exists($tempFilename)) {
         $output->writeln('<error>The download of the new composer version failed for an unexpected reason</error>');
         return 1;
     }
     // remove saved installations of composer
     if ($input->getOption('clean-backups')) {
         $finder = $this->getOldInstallationFinder($rollbackDir);
         $fs = new Filesystem();
         foreach ($finder as $file) {
             $file = (string) $file;
             $output->writeln('<info>Removing: ' . $file . '</info>');
             $fs->remove($file);
         }
     }
     if ($err = $this->setLocalPhar($localFilename, $tempFilename, $backupFile)) {
         $output->writeln('<error>The file is corrupted (' . $err->getMessage() . ').</error>');
         $output->writeln('<error>Please re-run the self-update command to try again.</error>');
         return 1;
     }
     if (file_exists($backupFile)) {
         $output->writeln('Use <info>composer self-update --rollback</info> to return to version ' . Composer::VERSION);
     } else {
         $output->writeln('<warning>A backup of the current version could not be written to ' . $backupFile . ', no rollback possible</warning>');
     }
 }
开发者ID:aminembarki,项目名称:composer,代码行数:60,代码来源:SelfUpdateCommand.php


示例13: execute

 /**
  * Search for packages.
  *
  * @param array   $packages Indexed array of package names to search for
  * @param boolean $onlyname True for name only search, false for full text
  *
  * @throws PackageManagerException
  *
  * @return array List of matching packages
  */
 public function execute($packages, $onlyname = true)
 {
     /** @var $composer \Composer\Composer */
     $composer = $this->getComposer();
     $io = $this->getIO();
     $platformRepo = new PlatformRepository();
     if ($composer) {
         $localRepo = $composer->getRepositoryManager()->getLocalRepository();
         $installedRepo = new CompositeRepository([$localRepo, $platformRepo]);
         $repos = new CompositeRepository(array_merge([$installedRepo], $composer->getRepositoryManager()->getRepositories()));
     } else {
         $defaultRepos = Factory::createDefaultRepositories($io);
         //No composer.json found in the current directory, showing packages from local repo
         $installedRepo = $platformRepo;
         $repos = new CompositeRepository(array_merge([$installedRepo], $defaultRepos));
     }
     $flags = $onlyname ? RepositoryInterface::SEARCH_NAME : RepositoryInterface::SEARCH_FULLTEXT;
     try {
         return $repos->search(implode(' ', $packages), $flags);
     } catch (\Exception $e) {
         $msg = __CLASS__ . '::' . __FUNCTION__ . ' recieved an error from Composer: ' . $e->getMessage() . ' in ' . $e->getFile() . '::' . $e->getLine();
         $this->app['logger.system']->critical($msg, ['event' => 'exception', 'exception' => $e]);
         throw new PackageManagerException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:atiarda,项目名称:bolt,代码行数:35,代码来源:SearchPackage.php


示例14: __construct

 /**
  * Constructor.
  *
  * @param IOInterface      $io               The IO instance
  * @param Config           $config           The composer configuration
  * @param ProcessExecutor  $process          Process instance, injectable for mocking
  * @param RemoteFilesystem $remoteFilesystem Remote Filesystem, injectable for mocking
  */
 public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
 {
     $this->io = $io;
     $this->config = $config;
     $this->process = $process ?: new ProcessExecutor();
     $this->remoteFilesystem = $remoteFilesystem ?: Factory::createRemoteFilesystem($this->io, $config);
 }
开发者ID:dazzle-libraries,项目名称:composer,代码行数:15,代码来源:Bitbucket.php


示例15: __construct

 /**
  * @param string $url
  * @param string $token
  * @param bool   $cacheDir
  * @param null   $bufferIO
  *
  * @throws \Exception
  */
 public function __construct($url, $token = '', $cacheDir = false, $bufferIO = null)
 {
     $this->url = $url;
     $this->io = new NullIO();
     $this->log = $bufferIO ? $bufferIO : new BufferIO();
     $config = Factory::createConfig();
     $cfg = ['config' => []];
     if ($cacheDir) {
         $cfg['config']['cache-dir'] = $cacheDir;
     }
     if ($token) {
         $cfg['config']['github-oauth'] = ['github.com' => $token];
     }
     $config->merge($cfg);
     $this->cacheDir = $cacheDir;
     $this->io->loadConfiguration($config);
     $this->repository = new Repository\VcsRepository(['url' => $url, 'no-api' => false], $this->io, $config);
     $driver = $this->vcsDriver = $this->repository->getDriver();
     if (!$driver) {
         throw new \Exception('No driver found for <' . $url . '>');
     }
     $this->driver = $driver;
     $composerInfoMaster = $this->driver->getComposerInformation($this->driver->getRootIdentifier());
     if (!$composerInfoMaster) {
         throw new \Exception('master must have a valid composer.json');
     }
     $this->name = $composerInfoMaster['name'];
     list($this->vendorName, $this->packageName) = explode('/', $this->name);
     preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):)([^/]+)/(.+?)(?:\\.git|/)?$#', $this->url, $match);
     $this->gitHubVendorName = $match[3];
     $this->gitHubRepositoryName = $match[4];
     $client = new \Github\Client();
     $client->authenticate($token, null, \GitHub\Client::AUTH_URL_TOKEN);
     $this->client = $client;
 }
开发者ID:Doanlmit,项目名称:pickleweb,代码行数:43,代码来源:Github.php


示例16: main

 /**
  * Removes patched packages.
  */
 public function main()
 {
     // Check if all required data is present.
     $this->checkRequirements();
     $composer = Factory::create(new NullIO(), $this->composerJsonPath);
     // Force discarding of changes, these packages are patched after all.
     // @todo Make this configurable with a "force" flag.
     $config = $composer->getConfig();
     $config->merge(['config' => ['discard-changes' => TRUE]]);
     // Get the list of patches.
     $extra = $composer->getPackage()->getExtra();
     if (!empty($extra['patches'])) {
         $repository = $composer->getRepositoryManager()->getLocalRepository();
         $installation_manager = $composer->getInstallationManager();
         // Loop over the patched packages.
         foreach (array_keys($extra['patches']) as $package_name) {
             foreach ($repository->findPackages($package_name) as $package) {
                 // Skip aliases, only remove the actual packages.
                 if (!$package instanceof AliasPackage) {
                     // Remove the package.
                     $this->log("Removing patched package '{$package_name}'.");
                     $operation = new UninstallOperation($package, 'Uninstalling patched package so it can be reinstalled.');
                     $installation_manager->uninstall($repository, $operation);
                 }
             }
         }
         // Re-generate the autoloader to get rid of stale class definitions.
         $generator = $composer->getAutoloadGenerator();
         $localRepo = $composer->getRepositoryManager()->getLocalRepository();
         $package = $composer->getPackage();
         $installationManager = $composer->getInstallationManager();
         $generator->dump($config, $localRepo, $package, $installationManager, 'composer');
     }
 }
开发者ID:ec-europa,项目名称:joinup-dev,代码行数:37,代码来源:RemovePatchedPackagesTask.php


示例17: __construct

 public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, RemoteFilesystem $rfs = null)
 {
     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)?(?:[?#].*)?$}', '$1', $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();
     $this->rfs = $rfs ?: Factory::createRemoteFilesystem($this->io, $this->config, $this->options);
     $this->eventDispatcher = $eventDispatcher;
     $this->repoConfig = $repoConfig;
 }
开发者ID:Nilz11,项目名称:composer,代码行数:31,代码来源:ComposerRepository.php


示例18: getComposer

 public function getComposer()
 {
     if ($this->composer === null) {
         $this->composer = Factory::create($this->io, null, false);
     }
     return $this->composer;
 }
开发者ID:opis-colibri,项目名称:core,代码行数:7,代码来源:AbstractScript.php


示例19: create

 /**
  * Create \Composer\Composer
  *
  * @return \Composer\Composer
  * @throws \Exception
  */
 public function create()
 {
     if (!getenv('COMPOSER_HOME')) {
         putenv('COMPOSER_HOME=' . $this->directoryList->getPath(DirectoryList::COMPOSER_HOME));
     }
     return \Composer\Factory::create(new BufferIO(), $this->composerJsonFinder->findComposerJson());
 }
开发者ID:mage2pro,项目名称:core,代码行数:13,代码来源:ComposerFactory.php


示例20: prepareCommand

 /**
  * {@inheritDoc}
  */
 protected function prepareCommand()
 {
     RuntimeHelper::setupHome($this->file->get(self::SETTING_HOME));
     $command = new UpdateCommand();
     $command->setComposer(Factory::create($this->getIO()));
     return $command;
 }
开发者ID:aschempp,项目名称:tenside-core,代码行数:10,代码来源:UpgradeTask.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Composer\Installer类代码示例发布时间:2022-05-23
下一篇:
PHP Composer\Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap