function run(array $argv) { set_time_limit(0); date_default_timezone_set("UTC"); try { $config = new Config($argv); } catch (InvalidConfigException $exception) { $this->usage(); exit(1); } $output = new \Guardrail\Output\XUnitOutput($config); if ($config->shouldIndex()) { $output->outputExtraVerbose("Indexing\n"); $indexer = new IndexingPhase(); $indexer->run($config, $output); $output->outputExtraVerbose("\nDone\n\n"); //$output->renderResults(); exit(0); } if ($config->shouldAnalyze()) { $analyzer = new AnalyzingPhase(); $output->outputExtraVerbose("Analyzing\n"); if (!$config->hasFileList()) { $exitCode = $analyzer->run($config, $output); } else { $list = $config->getFileList(); $exitCode = $analyzer->phase2($config, $output, $list); } $output->outputExtraVerbose("\nDone\n\n"); $output->renderResults(); //print_r($output->getErrorsByFile()); exit($exitCode); } }