本文整理汇总了PHP中Tracy\Dumper::terminalColors方法的典型用法代码示例。如果您正苦于以下问题:PHP Dumper::terminalColors方法的具体用法?PHP Dumper::terminalColors怎么用?PHP Dumper::terminalColors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Dumper
的用法示例。
在下文中一共展示了Dumper::terminalColors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @return int
* @throws \Exception
*/
public function run(InputInterface $input = NULL, OutputInterface $output = NULL)
{
$input = $input ?: new ArgvInput();
$output = $output ?: new ConsoleOutput();
if ($input->hasParameterOption('--debug-mode')) {
if ($input->hasParameterOption(['--debug-mode=no', '--debug-mode=off', '--debug-mode=false', '--debug-mode=0'])) {
if ($this->serviceLocator->parameters['debugMode']) {
$this->renderException(new InvalidApplicationModeException("The app is running in debug mode. You have to use Kdyby\\Console\\DI\\BootstrapHelper in app/bootstrap.php, " . "Kdyby\\Console cannot switch already running app to production mode . "), $output);
return self::INVALID_APP_MODE_EXIT_CODE;
}
} else {
if (!$this->serviceLocator->parameters['debugMode']) {
$this->renderException(new InvalidApplicationModeException("The app is running in production mode. You have to use Kdyby\\Console\\DI\\BootstrapHelper in app/bootstrap.php, " . "Kdyby\\Console cannot switch already running app to debug mode."), $output);
return self::INVALID_APP_MODE_EXIT_CODE;
}
}
}
if (class_exists('Tracy\\Dumper') && $input->hasParameterOption('--no-ansi')) {
Dumper::$terminalColors = FALSE;
}
try {
return parent::run($input, $output);
} catch (UnknownCommandException $e) {
$this->renderException($e->getPrevious(), $output);
list($message) = explode("\n", $e->getMessage());
Debugger::log($message, Debugger::ERROR);
return self::INPUT_ERROR_EXIT_CODE;
} catch (\Exception $e) {
if (in_array(get_class($e), self::$invalidArgumentExceptions, TRUE) && preg_match('/^(The "-?-?.+" (option|argument) (does not (exist|accept a value)|requires a value)|(Not enough|Too many) arguments.*)\\.$/', $e->getMessage()) === 1) {
$this->renderException($e, $output);
Debugger::log($e->getMessage(), Debugger::ERROR);
return self::INPUT_ERROR_EXIT_CODE;
} elseif ($app = $this->serviceLocator->getByType('Nette\\Application\\Application', FALSE)) {
/** @var Nette\Application\Application $app */
$app->onError($app, $e);
} else {
$this->handleException($e, $output);
}
return max(min((int) $e->getCode(), 254), 1);
}
}