/** * @param CodeReviewConfig $options */ public function __construct(CodeReviewConfig $options = null) { if ($options === null) { $options = new CodeReviewConfig(); } $this->options = $options; $this->maxVersion = $options->getMaxVersion(); $this->fixProblems = $options->isFixProblemsEnabled(); }
/** * @param Iterator $iterator * @param string $basePath * @param CodeReviewConfig $config * @throws CodeReview_IOException */ public function __construct($iterator, $basePath, CodeReviewConfig $config) { if (!is_dir($basePath)) { throw new CodeReview_IOException("Directory {$basePath} does not exists"); } $basePath = rtrim($basePath, '/\\') . '/'; $this->basePath = $basePath; if ($config->isSkipInactivePluginsEnabled()) { $pluginsDirs = $config->getPluginIds(CodeReviewConfig::T_PLUGINS_INACTIVE); foreach ($pluginsDirs as $pluginDir) { $this->blacklist[] = 'mod/' . $pluginDir . '/.*'; } // var_dump($this->blacklist); } parent::__construct($iterator); }
<?php admin_gatekeeper(); ini_set('max_execution_time', 0); $options = new CodeReviewConfig(); $options->parseInput($vars); /* * Produce output */ echo '<pre>'; $body = ''; $mt = microtime(true); try { $analyzer = new CodeReviewAnalyzer($options); $analyzer->analyze(); $body .= $analyzer->outputReport(); } catch (CodeReview_IOException $e) { echo "*** Error: " . $e->getMessage() . " ***\n"; } $body .= sprintf("Time taken: %.4fs\n", microtime(true) - $mt); echo $body; echo '</pre>';