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


PHP IOInterface::isVeryVerbose方法代码示例

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


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

示例1: debug

 /**
  * Log a debug message
  *
  * Messages will be output at the "very verbose" logging level (eg `-vv`
  * needed on the Composer command).
  *
  * @param string $message
  */
 public function debug($message)
 {
     if ($this->inputOutput->isVeryVerbose()) {
         $message = "  <info>[{$this->name}]</info> {$message}";
         $this->log($message);
     }
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:15,代码来源:Logger.php

示例2: writePatchNotice

 /**
  * Write a notice to IO
  *
  * @param string $action
  * @param \Netresearch\Composer\Patches\Patch $patch
  * @param \Composer\Package\PackageInterface $package
  * @param \Netresearch\Composer\Patches\Exception $exception
  */
 protected function writePatchNotice($action, Patch $patch, PackageInterface $package, $exception = null)
 {
     $adverbMap = array('test' => 'on', 'apply' => 'to', 'revert' => 'from');
     if ($action == 'test' && !$this->io->isVeryVerbose()) {
         return;
     }
     $msg = '  ' . ucfirst($action) . 'ing patch';
     if ($this->io->isVerbose() || !isset($patch->title)) {
         $msg .= ' <info>' . $patch->getChecksum() . '</info>';
     }
     $msg .= ' ' . $adverbMap[$action];
     $msg .= ' <info>' . $package->getName() . '</info>';
     if ($this->io->isVerbose()) {
         ' (<comment>' . $package->getPrettyVersion() . '</comment>)';
     }
     if (isset($patch->title)) {
         $msg .= ': <comment>' . $patch->title . '</comment>';
     }
     $this->io->write($msg);
     if ($exception) {
         $this->io->write('  <warning>Could not ' . $action . ' patch</warning>' . ($action == 'revert' ? ' (was probably not applied)' : ''));
         if ($this->io->isVerbose()) {
             $this->io->write('<warning>' . $exception->getMessage() . '</warning>');
         }
     }
 }
开发者ID:petr-castulik,项目名称:composer-patches-plugin,代码行数:34,代码来源:Plugin.php

示例3: runGrumPhpCommand

 /**
  * Run the GrumPHP console to (de)init the git hooks
  *
  * @param $command
  */
 protected function runGrumPhpCommand($command)
 {
     $config = $this->composer->getConfig();
     $baseDir = $this->getObjectProtectedProperty($config, 'baseDir');
     $configFilename = !empty($config->get('extra')['grumphp']['config-default-path']) ? $config->get('extra')['grumphp']['config-default-path'] : $baseDir . DIRECTORY_SEPARATOR . 'grumphp.yml';
     if (!file_exists($configFilename)) {
         // Check executable which is running:
         if ($this->io->isVeryVerbose()) {
             $this->io->write(sprintf('<fg=red>File "%s" not found</fg=red>', $configFilename));
         }
         return;
     }
     $application = new \Octava\GeggsApplication();
     /** @var Config $config */
     $config = $application->getContainer()->get('octava_geggs.config');
     $grumPhpConfigData = Yaml::parse(file_get_contents($configFilename));
     $fileSystem = new Filesystem();
     foreach ($config->getVendorDirs() as $item) {
         $grumPhpConfigData['bin_dir'] = '../../../bin';
         $grumPhpConfigYml = Yaml::dump($grumPhpConfigData);
         $vendorConfigFilename = implode(DIRECTORY_SEPARATOR, [$item, 'vendor', 'grumphp.yml']);
         $fileSystem->dumpFile($vendorConfigFilename, $grumPhpConfigYml);
         $gitPreCommitFilename = implode(DIRECTORY_SEPARATOR, [$item, '.git', 'hooks', 'pre-commit']);
         $fileSystem->dumpFile($gitPreCommitFilename, $this->generatePreCommit($vendorConfigFilename));
         $gitCommitMsgFilename = implode(DIRECTORY_SEPARATOR, [$item, '.git', 'hooks', 'commit-msg']);
         $fileSystem->dumpFile($gitCommitMsgFilename, $this->generateCommitMsg($vendorConfigFilename));
         if ($this->io->isVeryVerbose()) {
             $this->io->write(sprintf('Config created %s', $vendorConfigFilename));
             $this->io->write(sprintf('Pre commit hook created %s', $gitPreCommitFilename));
             $this->io->write(sprintf('Commit msg hook created %s', $gitCommitMsgFilename));
         }
     }
     $this->io->write('<fg=yellow>GrumPHP is sniffing your vendors code!</fg=yellow>');
 }
开发者ID:octava,项目名称:geggs,代码行数:39,代码来源:GrumPHPPlugin.php

示例4: __construct

 public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
 {
     $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', '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:hanovruslan,项目名称:composer,代码行数:10,代码来源:VcsRepository.php

示例5: linkBootstrapFiles

 /**
  * Symlink the bootstrapping code into the .git folder.
  *
  * @since 0.1.0
  *
  * @param Filesystem $filesystem Reference to the Filesystem instance.
  */
 protected function linkBootstrapFiles(Filesystem $filesystem)
 {
     $rootTemplate = Paths::getPath('root_template');
     $composterTemplate = Paths::getPath('git_template');
     $files = array('bootstrap.php');
     foreach ($files as $file) {
         if (static::$io->isVeryVerbose()) {
             static::$io->write(sprintf(_('Symlinking %1$s to %2$s'), $rootTemplate . $file, $composterTemplate . $file));
         }
         $filesystem->relativeSymlink($composterTemplate . $file, $rootTemplate . $file);
     }
 }
开发者ID:php-composter,项目名称:php-composter,代码行数:19,代码来源:Plugin.php

示例6: dumpVulnerabilities

 /**
  * @param IOInterface $io
  * @param array       $vulnerabilities
  */
 protected static function dumpVulnerabilities(IOInterface $io, array $vulnerabilities)
 {
     foreach ($vulnerabilities as $package => $infos) {
         $io->write("\n" . '  <info>' . $package . '</info> ' . $infos['version']);
         foreach ($infos['advisories'] as $key => $advisory) {
             $io->write('    <comment>' . $advisory['title'] . '</comment>');
             $io->write('    <info>' . $advisory['link'] . '</info>');
             if ($advisory['cve'] && $io->isVeryVerbose()) {
                 $io->write('    ' . $advisory['cve']);
             }
         }
     }
     $io->write("\n");
 }
开发者ID:beejhuff,项目名称:ComposerDependenciesSecurityChecker,代码行数:18,代码来源:ScriptHandler.php

示例7: isGitDiff

 /**
  * Return TRUE if the current git branch has any uncommitted changes.
  *
  * @return bool
  */
 protected function isGitDiff($branchName = '')
 {
     $output = '';
     $command = "git diff";
     if ($branchName) {
         $command .= ' ' . $this->git['base-branch'] . ' ' . $branchName;
     }
     if ($this->executor->execute($command, $output) == 0) {
         $output = trim($output);
         if ($this->io->isVeryVerbose() && $output) {
             $this->io->write("<comment>" . substr($output, 0, 10) . "...</comment>");
         }
         return $output ? TRUE : FALSE;
     }
     return FALSE;
 }
开发者ID:jbrauer,项目名称:drupal-composer-installer,代码行数:21,代码来源:DrupalInstallerPlugin.php

示例8: runGrumPhpCommand

 /**
  * Run the GrumPHP console to (de)init the git hooks
  *
  * @param $command
  */
 protected function runGrumPhpCommand($command)
 {
     $config = $this->composer->getConfig();
     $commandLocator = new ExternalCommand($config->get('bin-dir'), new ExecutableFinder());
     $executable = $commandLocator->locate('grumphp');
     $builder = new ProcessBuilder(array($executable, $command, '--no-interaction'));
     $process = $builder->getProcess();
     // Check executable which is running:
     if ($this->io->isVeryVerbose()) {
         $this->io->write('Running process : ' . $process->getCommandLine());
     }
     $process->run();
     if (!$process->isSuccessful()) {
         $this->io->write('<fg=red>GrumPHP can not sniff your commits. Did you specify the correct git-dir?</fg=red>');
         $this->io->write('<fg=red>' . $process->getErrorOutput() . '</fg=red>');
         return;
     }
     $this->io->write('<fg=yellow>' . $process->getOutput() . '</fg=yellow>');
 }
开发者ID:spinx,项目名称:grumphp,代码行数:24,代码来源:GrumPHPPlugin.php

示例9: writePatchNotice

 /**
  * Write a notice to IO
  *
  * @param string $action
  * @param \Netresearch\Composer\Patches\Patch $patch
  * @param \Composer\Package\PackageInterface $package
  */
 protected function writePatchNotice($action, Patch $patch, PackageInterface $package)
 {
     $adverbMap = array('test' => 'on', 'apply' => 'to', 'revert' => 'from');
     if ($action == 'test' && !$this->io->isVeryVerbose()) {
         return;
     }
     $msg = '  - ' . ucfirst($action) . 'ing patch';
     if ($this->io->isVerbose() || !isset($patch->title)) {
         $msg .= ' <info>' . $patch->getChecksum() . '</info>';
     }
     $msg .= ' ' . $adverbMap[$action];
     $msg .= ' <info>' . $package->getName() . '</info>';
     if ($this->io->isVerbose()) {
         ' (<comment>' . $package->getPrettyVersion() . '</comment>)';
     }
     if (isset($patch->title)) {
         $msg .= ': <comment>' . $patch->title . '</comment>';
     }
     $this->io->write($msg);
 }
开发者ID:rednut,项目名称:composer-patches-plugin,代码行数:27,代码来源:Plugin.php

示例10: doInstall


//.........这里部分代码省略.........
         $this->io->writeError('<info>Installing dependencies' . ($withDevReqs ? ' (including require-dev)' : '') . '</info>');
         if ($withDevReqs) {
             $links = array_merge($this->package->getRequires(), $this->package->getDevRequires());
         } else {
             $links = $this->package->getRequires();
         }
         foreach ($links as $link) {
             $request->install($link->getTarget(), $link->getConstraint());
         }
     }
     // force dev packages to have the latest links if we update or install from a (potentially new) lock
     $this->processDevPackages($localRepo, $pool, $policy, $repositories, $lockedRepository, $installFromLock, 'force-links');
     // solve dependencies
     $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request);
     $solver = new Solver($policy, $pool, $installedRepo);
     try {
         $operations = $solver->solve($request, $this->ignorePlatformReqs);
         $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request, $operations);
     } catch (SolverProblemsException $e) {
         $this->io->writeError('<error>Your requirements could not be resolved to an installable set of packages.</error>');
         $this->io->writeError($e->getMessage());
         return max(1, $e->getCode());
     }
     // force dev packages to be updated if we update or install from a (potentially new) lock
     $operations = $this->processDevPackages($localRepo, $pool, $policy, $repositories, $lockedRepository, $installFromLock, 'force-updates', $operations);
     // execute operations
     if (!$operations) {
         $this->io->writeError('Nothing to install or update');
     }
     $operations = $this->movePluginsToFront($operations);
     $operations = $this->moveUninstallsToFront($operations);
     foreach ($operations as $operation) {
         // collect suggestions
         if ('install' === $operation->getJobType()) {
             foreach ($operation->getPackage()->getSuggests() as $target => $reason) {
                 $this->suggestedPackages[] = array('source' => $operation->getPackage()->getPrettyName(), 'target' => $target, 'reason' => $reason);
             }
         }
         // not installing from lock, force dev packages' references if they're in root package refs
         if (!$installFromLock) {
             $package = null;
             if ('update' === $operation->getJobType()) {
                 $package = $operation->getTargetPackage();
             } elseif ('install' === $operation->getJobType()) {
                 $package = $operation->getPackage();
             }
             if ($package && $package->isDev()) {
                 $references = $this->package->getReferences();
                 if (isset($references[$package->getName()])) {
                     $package->setSourceReference($references[$package->getName()]);
                     $package->setDistReference($references[$package->getName()]);
                 }
             }
             if ('update' === $operation->getJobType() && $operation->getTargetPackage()->isDev() && $operation->getTargetPackage()->getVersion() === $operation->getInitialPackage()->getVersion() && $operation->getTargetPackage()->getSourceReference() === $operation->getInitialPackage()->getSourceReference()) {
                 if ($this->io->isDebug()) {
                     $this->io->writeError('  - Skipping update of ' . $operation->getTargetPackage()->getPrettyName() . ' to the same reference-locked version');
                     $this->io->writeError('');
                 }
                 continue;
             }
         }
         $event = 'Composer\\Installer\\PackageEvents::PRE_PACKAGE_' . strtoupper($operation->getJobType());
         if (defined($event) && $this->runScripts) {
             $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
         }
         // output non-alias ops in dry run, output alias ops in debug verbosity
         if ($this->dryRun && false === strpos($operation->getJobType(), 'Alias')) {
             $this->io->writeError('  - ' . $operation);
             $this->io->writeError('');
         } elseif ($this->io->isDebug() && false !== strpos($operation->getJobType(), 'Alias')) {
             $this->io->writeError('  - ' . $operation);
             $this->io->writeError('');
         }
         $this->installationManager->execute($localRepo, $operation);
         // output reasons why the operation was ran, only for install/update operations
         if ($this->verbose && $this->io->isVeryVerbose() && in_array($operation->getJobType(), array('install', 'update'))) {
             $reason = $operation->getReason();
             if ($reason instanceof Rule) {
                 switch ($reason->getReason()) {
                     case Rule::RULE_JOB_INSTALL:
                         $this->io->writeError('    REASON: Required by root: ' . $reason->getPrettyString($pool));
                         $this->io->writeError('');
                         break;
                     case Rule::RULE_PACKAGE_REQUIRES:
                         $this->io->writeError('    REASON: ' . $reason->getPrettyString($pool));
                         $this->io->writeError('');
                         break;
                 }
             }
         }
         $event = 'Composer\\Installer\\PackageEvents::POST_PACKAGE_' . strtoupper($operation->getJobType());
         if (defined($event) && $this->runScripts) {
             $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
         }
         if (!$this->dryRun) {
             $localRepo->write();
         }
     }
     return 0;
 }
开发者ID:Flesh192,项目名称:magento,代码行数:101,代码来源:Installer.php

示例11: doInstall


//.........这里部分代码省略.........
     // we also force them to be uninstalled if they are present in the local repo
     if ($this->update) {
         $devPackages = $this->extractDevPackages($operations, $localRepo, $platformRepo, $aliases);
         if (!$this->devMode) {
             $operations = $this->filterDevPackageOperations($devPackages, $operations, $localRepo);
         }
     } else {
         $devPackages = null;
     }
     if ($operations) {
         $installs = $updates = $uninstalls = array();
         foreach ($operations as $operation) {
             if ($operation instanceof InstallOperation) {
                 $installs[] = $operation->getPackage()->getPrettyName() . ':' . $operation->getPackage()->getFullPrettyVersion();
             } elseif ($operation instanceof UpdateOperation) {
                 $updates[] = $operation->getTargetPackage()->getPrettyName() . ':' . $operation->getTargetPackage()->getFullPrettyVersion();
             } elseif ($operation instanceof UninstallOperation) {
                 $uninstalls[] = $operation->getPackage()->getPrettyName();
             }
         }
         $this->io->writeError(sprintf("<info>Package operations: %d install%s, %d update%s, %d removal%s</info>", count($installs), 1 === count($installs) ? '' : 's', count($updates), 1 === count($updates) ? '' : 's', count($uninstalls), 1 === count($uninstalls) ? '' : 's'));
         if ($installs) {
             $this->io->writeError("Installs: " . implode(', ', $installs), true, IOInterface::VERBOSE);
         }
         if ($updates) {
             $this->io->writeError("Updates: " . implode(', ', $updates), true, IOInterface::VERBOSE);
         }
         if ($uninstalls) {
             $this->io->writeError("Removals: " . implode(', ', $uninstalls), true, IOInterface::VERBOSE);
         }
     }
     foreach ($operations as $operation) {
         // collect suggestions
         if ('install' === $operation->getJobType()) {
             $this->suggestedPackagesReporter->addSuggestionsFromPackage($operation->getPackage());
         }
         // updating, force dev packages' references if they're in root package refs
         if ($this->update) {
             $package = null;
             if ('update' === $operation->getJobType()) {
                 $package = $operation->getTargetPackage();
             } elseif ('install' === $operation->getJobType()) {
                 $package = $operation->getPackage();
             }
             if ($package && $package->isDev()) {
                 $references = $this->package->getReferences();
                 if (isset($references[$package->getName()])) {
                     $this->updateInstallReferences($package, $references[$package->getName()]);
                 }
             }
             if ('update' === $operation->getJobType() && $operation->getTargetPackage()->isDev() && $operation->getTargetPackage()->getVersion() === $operation->getInitialPackage()->getVersion() && (!$operation->getTargetPackage()->getSourceReference() || $operation->getTargetPackage()->getSourceReference() === $operation->getInitialPackage()->getSourceReference()) && (!$operation->getTargetPackage()->getDistReference() || $operation->getTargetPackage()->getDistReference() === $operation->getInitialPackage()->getDistReference())) {
                 $this->io->writeError('  - Skipping update of ' . $operation->getTargetPackage()->getPrettyName() . ' to the same reference-locked version', true, IOInterface::DEBUG);
                 $this->io->writeError('', true, IOInterface::DEBUG);
                 continue;
             }
         }
         $event = 'Composer\\Installer\\PackageEvents::PRE_PACKAGE_' . strtoupper($operation->getJobType());
         if (defined($event) && $this->runScripts) {
             $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
         }
         // output non-alias ops in dry run, output alias ops in debug verbosity
         if ($this->dryRun && false === strpos($operation->getJobType(), 'Alias')) {
             $this->io->writeError('  - ' . $operation);
             $this->io->writeError('');
         } elseif ($this->io->isDebug() && false !== strpos($operation->getJobType(), 'Alias')) {
             $this->io->writeError('  - ' . $operation);
             $this->io->writeError('');
         }
         $this->installationManager->execute($localRepo, $operation);
         // output reasons why the operation was ran, only for install/update operations
         if ($this->verbose && $this->io->isVeryVerbose() && in_array($operation->getJobType(), array('install', 'update'))) {
             $reason = $operation->getReason();
             if ($reason instanceof Rule) {
                 switch ($reason->getReason()) {
                     case Rule::RULE_JOB_INSTALL:
                         $this->io->writeError('    REASON: Required by the root package: ' . $reason->getPrettyString($pool));
                         $this->io->writeError('');
                         break;
                     case Rule::RULE_PACKAGE_REQUIRES:
                         $this->io->writeError('    REASON: ' . $reason->getPrettyString($pool));
                         $this->io->writeError('');
                         break;
                 }
             }
         }
         $event = 'Composer\\Installer\\PackageEvents::POST_PACKAGE_' . strtoupper($operation->getJobType());
         if (defined($event) && $this->runScripts) {
             $this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
         }
         if (!$this->dryRun) {
             $localRepo->write();
         }
     }
     if (!$this->dryRun) {
         // force source/dist urls to be updated for all packages
         $this->processPackageUrls($pool, $policy, $localRepo, $repositories);
         $localRepo->write();
     }
     return array(0, $devPackages);
 }
开发者ID:Rudloff,项目名称:composer,代码行数:101,代码来源:Installer.php

示例12: output

 /**
  * Print a message in the user console
  *
  * @param string $level   The message level ("normal", "verbose", "very-verbose", "debug")
  * @param string $message The message (sprintf format)
  * @param array  $vars    The message variables
  *
  * @return void
  */
 protected function output($level, $message, array $vars = array())
 {
     if ('normal' === $level || 'verbose' === $level && $this->io->isVerbose() || 'very-verbose' === $level && $this->io->isVeryVerbose() || 'debug' === $level && $this->io->isDebug()) {
         $this->io->write(vsprintf($message, $vars));
     }
 }
开发者ID:MacFJA,项目名称:ComposerClassRewrite,代码行数:15,代码来源:Plugin.php


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