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


PHP Debugger::browser方法代码示例

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


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

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output) : int
 {
     $rootDir = realpath(__DIR__ . '/../..');
     $tmpDir = $rootDir . '/tmp';
     $confDir = $rootDir . '/conf';
     $configurator = new Configurator();
     $configurator->defaultExtensions = [];
     $configurator->setDebugMode(true);
     $configurator->setTempDirectory($tmpDir);
     $configurator->enableDebugger($tmpDir . '/log');
     $projectConfigFile = $input->getOption('configuration');
     $levelOption = $input->getOption(self::OPTION_LEVEL);
     if ($projectConfigFile === null && $levelOption === null) {
         $levelOption = self::DEFAULT_LEVEL;
     }
     $configFiles = [$confDir . '/config.neon'];
     if ($levelOption !== null) {
         $levelConfigFile = sprintf('%s/config.level%s.neon', $confDir, $levelOption);
         if (!is_file($levelConfigFile)) {
             $output->writeln(sprintf('Level config file %s was not found.', $levelConfigFile));
             return 1;
         }
         $configFiles[] = $levelConfigFile;
     }
     if ($projectConfigFile !== null) {
         $projectConfigRealFilePath = realpath($projectConfigFile);
         if (!is_file($projectConfigFile)) {
             $output->writeln(sprintf('Project config file at path %s does not exist.', $projectConfigRealFilePath !== false ? $projectConfigRealFilePath : $projectConfigFile));
             return 1;
         }
         $configFiles[] = $projectConfigRealFilePath;
     }
     foreach ($configFiles as $configFile) {
         $configurator->addConfig($configFile);
     }
     $configurator->addParameters(['rootDir' => $rootDir]);
     $container = $configurator->createContainer();
     if (!isset($container->parameters['customRulesetUsed'])) {
         $output->writeln('');
         $output->writeln('<comment>No rules detected</comment>');
         $output->writeln('');
         $output->writeln('You have the following choices:');
         $output->writeln('');
         $output->writeln('* while running the analyse option, use the <info>--level</info> option to adjust your rule level - the higher the stricter');
         $output->writeln('');
         $output->writeln(sprintf('* create your own <info>custom ruleset</info> by selecting which rules you want to check by copying the service definitions from the built-in config level files in <options=bold>%s</>.', realpath(__DIR__ . '/../../conf')));
         $output->writeln('  * in this case, don\'t forget to define parameter <options=bold>customRulesetUsed</> in your config file.');
         $output->writeln('');
         return 1;
     }
     Debugger::$browser = $container->parameters['debug_cli_browser'];
     foreach ($container->parameters['autoload_files'] as $autoloadFile) {
         require_once $autoloadFile;
     }
     if (count($container->parameters['autoload_directories']) > 0) {
         $robotLoader = new \Nette\Loaders\RobotLoader();
         $robotLoader->setCacheStorage(new \Nette\Caching\Storages\MemoryStorage());
         foreach ($container->parameters['autoload_directories'] as $directory) {
             $robotLoader->addDirectory($directory);
         }
         $robotLoader->register();
     }
     $application = $container->getByType(AnalyseApplication::class);
     return $application->analyse($input->getArgument('paths'), new ErrorsConsoleStyle($input, $output));
 }
开发者ID:phpstan,项目名称:phpstan,代码行数:65,代码来源:AnalyseCommand.php


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