public function run()
{
$project = 'test';
// Check for requested file
if (!empty($this->config->filename) && !file_exists($this->config->filename)) {
throw new NoSuchFile($this->config->filename);
} elseif (!empty($this->config->dirname) && !file_exists($this->config->dirname)) {
throw new NoSuchDir($this->config->filename);
}
// Check for requested analyze
$analyzer = $this->config->program;
if (Analyzer::getClass($analyzer)) {
$analyzers_class = array($analyzer);
} else {
$r = Analyzer::getSuggestionClass($analyzer);
if (count($r) > 0) {
echo 'did you mean : ', implode(', ', str_replace('_', '/', $r)), "\n";
}
throw new NoSuchAnalyzer($analyzer);
}
display("Cleaning DB\n");
$clean = new CleanDb($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$clean->run();
$load = new Load($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$load->run();
unset($load);
display("Project loaded\n");
$analyze = new Analyze($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$analyze->run();
unset($analyze);
$results = new Results($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$results->run();
unset($results);
display("Analyzed project\n");
}