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


PHP OutputInterface::isDebug方法代码示例

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


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

示例1: testEnv

 private function testEnv(array $functions, $url, OutputInterface $output)
 {
     $soapClient = new \SoapClient($url, array('cache_wsdl' => 0, 'trace' => 1, 'soap_version' => SOAP_1_1));
     foreach ($functions as $function => $parameters) {
         $output->writeln('Test de la fonction soap <comment>' . $function . '</comment>');
         $output->writeln('Parameters : ');
         dump($parameters);
         if (!array_key_exists('methodCall', $this->config) || $this->config['methodCall'] == 'soapCall') {
             $result = $soapClient->__soapCall($function, $parameters);
         } else {
             $result = $soapClient->{$function}($parameters);
         }
         $headers = $soapClient->__getLastResponseHeaders();
         if ($output->isDebug()) {
             $output->writeln('Entete de la reponse : ');
             dump($headers);
         }
         if (false === ($site = $this->getSiteHeader($headers))) {
             throw new \Exception('Site Header introuvable dans la réponse.', 1);
         }
         $output->writeln('Serveur ayant repondu : <info>' . $site . '</info>');
         $output->writeln('Reponse : ');
         dump($result);
         if ($output->isDebug()) {
             dump($soapClient->__getLastResponse());
         }
     }
 }
开发者ID:macintoshplus,项目名称:TestWebService,代码行数:28,代码来源:WsSoap.php

示例2: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     Wp::load();
     $targetTheme = null;
     $targetThemeSlug = $input->getArgument('theme');
     if (static::CURRENT_THEME == $input->getArgument('theme')) {
         // no user chosen theme: load current
         /** @var \WP_Theme $targetTheme */
         $targetTheme = wp_get_theme();
         $targetThemeSlug = $targetTheme->get_stylesheet();
     }
     if (!$targetTheme) {
         // load user chosen theme
         $targetTheme = wp_get_theme($targetThemeSlug);
     }
     if (!$targetTheme->exists()) {
         throw new \DomainException('Theme ' . $targetThemeSlug . ' does not exist.');
     }
     if ($output->isDebug()) {
         $output->writeln('Theme: ' . $targetTheme->get_stylesheet());
     }
     $morphMethod = $this->getMorphMethod($input);
     // resolve readable name
     $name = $targetThemeSlug;
     if ($targetTheme->get('Name')) {
         $name = $targetTheme->get('Name');
     }
     $this->verbose('Checking ' . $name);
     // resolve theme text domain
     $textDomain = $name;
     if ($targetTheme->get('TextDomain')) {
         $textDomain = $targetTheme->get('TextDomain');
     }
     $this->verbose(' (TextDomain: ' . $textDomain . ')' . PHP_EOL);
     $langPath = WpTheme::resolveLanguagesPath($targetTheme);
     // fetch strings
     $extractor = new WordPressExtractor();
     $extractor::$extractComments = true;
     $extractor::$textDomain = $textDomain;
     $translatable = $extractor->fromDirectory($targetTheme->get_stylesheet_directory());
     // todo B fetch and merge translations from po file
     $translatable->setDomain($textDomain);
     $translatable->ksort();
     // skeleton created
     // file name is same as the slug which is a common way if you look at twenty* themes.
     $skeletonBasename = $targetThemeSlug . '.' . $input->getOption('format');
     if ('po' == $input->getOption('format')) {
         // po templates have the pot extension in the filename
         $skeletonBasename .= 't';
     }
     // merge with existing template
     $skeletonPath = $langPath . '/' . $skeletonBasename;
     $extractMethod = 'from' . ucfirst($input->getOption('format')) . 'File';
     /** @var Translations $skeletonTranslation */
     $skeletonTranslation = call_user_func(['\\Gettext\\Translations', $extractMethod], [$skeletonPath]);
     $this->sanitizeTranslation($translatable, $textDomain, $targetTheme->get_stylesheet_directory());
     $skeletonTranslation->mergeWith($translatable, $translatable::MERGE_ADD | $translatable::MERGE_REFERENCES);
     $this->writeTranslation($input, $output, $skeletonPath, $skeletonTranslation);
     $this->updateTranslations($input, $output, $targetTheme, $skeletonTranslation, $textDomain);
 }
开发者ID:sourcerer-mike,项目名称:wp-easy-translate,代码行数:60,代码来源:ThemeCommand.php

示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $serverSection = $input->getOption('server');
     $config = new \Zend_Config_Ini('config.ini', $serverSection);
     $server = $config->server;
     if (!isset($server->host)) {
         throw new \Exception("Invalid server settings for section '{$serverSection}': host is required");
     }
     if (isset($server->user)) {
         $host = $server->user . '@' . $server->host;
     } else {
         $host = $server->host;
     }
     if (isset($server->port)) {
         $host .= ' -p ' . $server->port;
     }
     if (isset($server->dir)) {
         $cmd = "cd " . $server->dir . ';';
     }
     $gitEnvVars = "GIT_AUTHOR_NAME=" . escapeshellarg(isset($_ENV['GIT_AUTHOR_NAME']) ? $_ENV['GIT_AUTHOR_NAME'] : trim(`git config user.name`)) . " GIT_AUTHOR_EMAIL=" . escapeshellarg(isset($_ENV['GIT_AUTHOR_EMAIL']) ? $_ENV['GIT_AUTHOR_EMAIL'] : trim(`git config user.email`)) . " GIT_COMMITTER_NAME=" . escapeshellarg(isset($_ENV['GIT_COMITTER_NAME']) ? $_ENV['GIT_COMITTER_NAME'] : trim(`git config user.name`)) . " GIT_COMMITTER_EMAIL=" . escapeshellarg(isset($_ENV['GIT_COMITTER_EMAIL']) ? $_ENV['GIT_COMITTER_EMAIL'] : trim(`git config user.email`));
     $cmd .= $gitEnvVars . ' ';
     $cmd .= "exec bash";
     $cmd = "ssh -t {$host} " . escapeshellarg($cmd);
     if ($output->isDebug()) {
         $output->writeln($cmd);
     }
     $ret = null;
     passthru($cmd, $ret);
     exit($ret);
 }
开发者ID:koala-framework,项目名称:kwf-deploy,代码行数:30,代码来源:ShellCommand.php

示例4: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $manifest = Manifest::download($this->pharUpdateManifestUrl, $output->isDebug());
     $manager = new Manager($manifest, $this->getLocalFilesystem());
     !$this->logger ?: $manager->setLogger($this->logger);
     $currentVersion = $this->getApplication()->getVersion();
     $newVersion = null !== $input->getArgument('version') ? $input->getArgument('version') : null;
     $major = $input->getOption('major');
     // Lock to current major version?
     $pre = true;
     //Allow pre-releases?
     if (false === $manager->update($currentVersion, $major, $pre, $newVersion, $output->isDebug())) {
         return self::EXIT_ERROR;
     }
     return self::EXIT_SUCCESS;
 }
开发者ID:MatthieuPresse,项目名称:jarvis,代码行数:19,代码来源:SelfUpdateCommand.php

示例5: run

 /**
  * Runs an external process.
  *
  * @param OutputInterface      $output    An OutputInterface instance
  * @param string|array|Process $cmd       An instance of Process or an array of arguments to escape and run or a command to run
  * @param string|null          $error     An error message that must be displayed if something went wrong
  * @param callable|null        $callback  A PHP callback to run whenever there is some
  *                                        output available on STDOUT or STDERR
  * @param int                  $verbosity The threshold for verbosity
  *
  * @return Process The process that ran
  */
 public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
 {
     $formatter = $this->getHelperSet()->get('debug_formatter');
     if (is_array($cmd)) {
         $process = ProcessBuilder::create($cmd)->getProcess();
     } elseif ($cmd instanceof Process) {
         $process = $cmd;
     } else {
         $process = new Process($cmd);
     }
     if ($verbosity <= $output->getVerbosity()) {
         $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine())));
     }
     if ($output->isDebug()) {
         $callback = $this->wrapCallback($output, $process, $callback);
     }
     $process->run($callback);
     if ($verbosity <= $output->getVerbosity()) {
         $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode());
         $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful()));
     }
     if (!$process->isSuccessful() && null !== $error) {
         $output->writeln(sprintf('<error>%s</error>', $this->escapeString($error)));
     }
     return $process;
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:38,代码来源:ProcessHelper.php

示例6: buildProcess

 /**
  * Build Process instance for each testcase file
  *
  * @param string $fileName
  * @param array $phpunitArgs
  * @return Process
  */
 protected function buildProcess($fileName, array $phpunitArgs = [])
 {
     $processBuilder = new ProcessBuilder();
     $dispatcher = $this->command->getDispatcher();
     $dispatcher->dispatch(CommandEvents::RUN_TESTS_PROCESS, $processEvent = new RunTestsProcessEvent($this->command, $this->input, $this->output, $processBuilder, $phpunitArgs));
     $process = $processBuilder->setEnv('BROWSER_NAME', $this->input->getArgument('browser'))->setEnv('ENV', strtolower($this->input->getArgument('environment')))->setEnv('SERVER_URL', $this->input->getOption('server-url'))->setEnv('PUBLISH_RESULTS', $this->input->getOption('publish-results') ? '1' : '0')->setEnv('FIXTURES_DIR', $this->input->getOption('fixtures-dir'))->setEnv('LOGS_DIR', $this->input->getOption('logs-dir'))->setEnv('DEBUG', $this->output->isDebug() ? '1' : '0')->setPrefix(STEWARD_BASE_DIR . '/vendor/bin/phpunit')->setArguments(array_merge($processEvent->getArgs(), [$fileName]))->setTimeout(3600)->getProcess();
     return $process;
 }
开发者ID:mhujer,项目名称:steward,代码行数:15,代码来源:ProcessSetCreator.php

示例7: executeCommandByProject

 /**
  * {@inheritdoc}
  */
 protected function executeCommandByProject($projectName, ProjectConfiguration $projectConfig, OutputInterface $output)
 {
     $this->getSshExec()->passthru(strtr('cd %project_dir% && /usr/local/bin/sami update sami_config.php' . ($output->isDebug() ? ' -v' : ''), ['%project_dir%' => $projectConfig->getRemoteWebappDir()]));
     $localBuildDir = sprintf('%s/build/apidoc', $projectConfig->getLocalWebappDir());
     $apiDocIndexFilepath = strtr('%build_dir%/index.html', ['%project_name%' => $projectConfig->getProjectName(), '%build_dir%' => $localBuildDir]);
     if (file_exists($apiDocIndexFilepath)) {
         $this->openFile($apiDocIndexFilepath);
     }
 }
开发者ID:MatthieuPresse,项目名称:jarvis,代码行数:12,代码来源:PhpDocCommand.php

示例8: debug

 /**
  * Creates a debug message.
  */
 public function debug($message, \PhpParser\Node $expr = null)
 {
     if ($this->output->isDebug()) {
         $this->output->writeln('[DEBUG] ' . $message);
         $this->output->write($this->filepath);
         if ($expr) {
             $this->output->write(':' . $expr->getLine());
         }
         $this->output->writeln('');
     }
 }
开发者ID:ovr,项目名称:phpsa,代码行数:14,代码来源:Context.php

示例9: _systemCheckRet

 private function _systemCheckRet($cmd, InputInterface $input, OutputInterface $output)
 {
     $ret = null;
     if ($output->isDebug()) {
         $output->writeln($cmd);
     }
     passthru($cmd, $ret);
     if ($ret != 0) {
         throw new \Exception("command failed");
     }
 }
开发者ID:koala-framework,项目名称:kwf-deploy,代码行数:11,代码来源:RsyncCommand.php

示例10: executeCommandByProject

 /**
  * @{inheritdoc}
  */
 protected function executeCommandByProject($projectName, ProjectConfiguration $projectConfig, OutputInterface $output)
 {
     $remoteReportFilePath = strtr('%build_dir%/%project_name%.html', ['%project_name%' => $projectConfig->getProjectName(), '%build_dir%' => $this->remoteBuildDir]);
     // Analyse source project code
     $this->getSshExec()->passthru(strtr('mkdir -p %build_dir% && /usr/local/bin/phpmetrics --level=0 --report-html=%report_file% %project_dir%/src' . ($output->isDebug() ? ' --verbose' : ''), ['%report_file%' => $remoteReportFilePath, '%build_dir%' => $this->remoteBuildDir, '%project_dir%' => $projectConfig->getRemoteWebappDir()]));
     $localReportFilePath = str_replace($this->remoteBuildDir, $this->localBuildDir, $remoteReportFilePath);
     $this->getRemoteFilesystem()->copyRemoteFileToLocal($remoteReportFilePath, $localReportFilePath);
     if ($this->getLocalFilesystem()->exists($localReportFilePath)) {
         $this->openFile($localReportFilePath);
     }
     return $this->getSshExec()->getLastReturnStatus();
 }
开发者ID:MatthieuPresse,项目名称:jarvis,代码行数:15,代码来源:PhpMetricsCommand.php

示例11: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $host = $input->getOption('host');
     $username = $input->getOption('username');
     $password = $input->getOption('password');
     //Debug: print received options
     if ($output->isDebug()) {
         $output->writeln("host=" . $host);
         $output->writeln("username=" . $username);
         $output->writeln("password=" . $password);
     }
 }
开发者ID:joncutrer,项目名称:tikomatic,代码行数:12,代码来源:TikCommand.php

示例12: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('Get weather info from yandex. CityId = ' . $this->_config['weather']['cityId']);
     $info = new \Petun\YaSpeech\Weather\Info($this->_config['weather']['cityId']);
     $composer = new \Petun\YaSpeech\Weather\Composer($info);
     if ($output->isDebug()) {
         $output->writeln('Generated text is ' . $composer->getComposition($this->_config['weather']['composition']));
     }
     $output->writeln('Send text to yandex speech');
     $speech = new \Petun\YaSpeech\Speech\Processor($this->_config['speech']['apiKey'], $this->_config['speech']['speaker'], $this->_config['speech']['emotion']);
     $content = $speech->getMp3($composer->getComposition($this->_config['weather']['composition']));
     if ($content) {
         $fileToSave = $this->_config['cacheDir'] . '/today_weather.mp3';
         $output->writeln('Save to file - ' . $fileToSave);
         $bytes = file_put_contents($fileToSave, $content);
         if ($output->isDebug()) {
             $output->writeln('Write ' . $bytes . ' bytes');
         }
     } else {
         $output->writeln('Error while download file');
     }
 }
开发者ID:petun,项目名称:ya-weather-speech,代码行数:22,代码来源:SpeechGenerationCommand.php

示例13: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var ConsoleOutput $output */
     $container = $this->getContainer();
     $logger = $container->get('logger');
     /** @var LocaleRepository $localeRepository */
     $localeRepository = $container->get('doctrine')->getManager()->getRepository('OmCmsI18nBundle:Locale');
     $aliases = $localeRepository->getActiveAliases();
     if ($output->isDebug()) {
         $logger->debug('Find aliases', $aliases);
     }
     $parameters = ['parameters' => ['om_cms_i18n.locale.aliases' => $aliases]];
     $filename = $container->getParameter('om_cms_i18n.locale.filename');
     $fs = new Filesystem();
     $dumper = new Dumper();
     $data = $dumper->dump($parameters);
     $fs->dumpFile($filename, $data);
     if ($output->isDebug()) {
         $logger->debug('Dump data', ['filename' => $filename, $data]);
     }
     if ($input->getOption('cache-clear')) {
         $cmd = $this->getContainer()->getParameter('kernel.root_dir') . '/console ';
         $inputParameters = ['command' => 'cache:clear', '--env' => $container->getParameter('kernel.environment')];
         if ($output->getVerbosity() <= OutputInterface::VERBOSITY_NORMAL) {
             $inputParameters['--no-debug'] = null;
         }
         $cmd .= (new ArrayInput($inputParameters))->__toString();
         $process = new Process($cmd);
         $process->mustRun(function ($type, $buffer) use($output) {
             if (Process::ERR === $type) {
                 $output->write('<error>' . $buffer . '</error>');
             } else {
                 if ($output->isDebug()) {
                     $output->write($buffer);
                 }
             }
         });
     }
 }
开发者ID:TheRatG,项目名称:om-cms,代码行数:39,代码来源:LocaleUpdateCommand.php

示例14: executeCommandByProject

 /**
  * @{inheritdoc}
  */
 protected function executeCommandByProject($projectName, ProjectConfiguration $projectConfig, OutputInterface $output)
 {
     $this->getSshExec()->passthru(strtr('cd %project_dir% && phpspec run --format=%format% --stop-on-failure ' . ($output->isDebug() ? ' --verbose' : ''), ['%format%' => $this->format, '%project_dir%' => $projectConfig->getRemoteWebappDir()]));
     $buildDir = $this->remoteBuildDir . '/tests';
     $this->getRemoteFilesystem()->mkdir($buildDir);
     $report = $this->getSshExec()->exec(strtr('cd %project_dir% && phpspec run --format=html --no-interaction > %build_dir%/unit.html', ['%project_dir%' => $projectConfig->getRemoteWebappDir(), '%build_dir%' => $buildDir]));
     $this->getRemoteFilesystem()->syncRemoteToLocal($this->remoteBuildDir, $this->localBuildDir, ['delete' => true]);
     $statusCode = $this->getSshExec()->getLastReturnStatus() == 0 && strpos($report, 'broken') === false ? 0 : 1;
     if ($this->displayStatusText) {
         $output->writeln(sprintf('<comment>Executes unit tests for project "<info>%s</info>"</comment>: %s', $projectName, $statusCode == 0 ? '<info>SUCCESS</info>' : '<error>ERROR</error>'));
     }
     return $statusCode;
 }
开发者ID:MatthieuPresse,项目名称:jarvis,代码行数:16,代码来源:TestUnitCommand.php

示例15: runTests

 /**
  * @param Process $process
  * @param OutputInterface $output
  */
 private function runTests($process, $output)
 {
     if ($output->isDebug()) {
         $process->run(function ($type, $buffer) use($output) {
             if (Process::ERR === $type) {
                 $output->write('<fg=yellow>' . $buffer . '</fg=yellow>');
             } else {
                 $output->write($buffer);
             }
         });
     } else {
         $process->run();
     }
 }
开发者ID:bitban,项目名称:php-code-quality-tools,代码行数:18,代码来源:RunCommand.php


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