getHash() публичный Метод

public getHash ( $key )
Пример #1
0
 protected function AuditConfiguration()
 {
     $css = new \Stdclass();
     $css->displayTitles = false;
     $css->titles = array(0, 1);
     $css->readOrder = $css->titles;
     $info = array(array('Code name', $this->config->project_name));
     if (!empty($this->config->project_description)) {
         $info[] = array('Code description', $this->config->project_description);
     }
     if (!empty($this->config->project_packagist)) {
         $info[] = array('Packagist', '<a href="https://packagist.org/packages/' . $this->config->project_packagist . '">' . $this->config->project_packagist . '</a>');
     }
     if (!empty($this->config->project_url)) {
         $info[] = array('Home page', '<a href="' . $this->config->project_url . '">' . $this->config->project_url . '</a>');
     }
     if (file_exists($this->config->projects_root . '/projects/' . $this->config->project . '/code/.git/config')) {
         $gitConfig = file_get_contents($this->config->projects_root . '/projects/' . $this->config->project . '/code/.git/config');
         preg_match('#url = (\\S+)\\s#is', $gitConfig, $r);
         $info[] = array('Git URL', $r[1]);
         $res = shell_exec('cd ' . $this->config->projects_root . '/projects/' . $this->config->project . '/code/; git branch');
         $info[] = array('Git branch', trim($res));
         $res = shell_exec('cd ' . $this->config->projects_root . '/projects/' . $this->config->project . '/code/; git rev-parse HEAD');
         $info[] = array('Git commit', trim($res));
     } else {
         $info[] = array('Repository URL', 'Downloaded archive');
     }
     $datastore = new Datastore($this->config);
     $info[] = array('Number of PHP files', $datastore->getHash('files'));
     $info[] = array('Number of lines of code', $datastore->getHash('loc'));
     $info[] = array('Number of lines of code with comments', $datastore->getHash('locTotal'));
     $info[] = array('Report production date', date('r', strtotime('now')));
     $php = new Phpexec($this->config->phpversion);
     $info[] = array('PHP used', $php->getActualVersion() . ' (version ' . $this->config->phpversion . ' configured)');
     $info[] = array('Ignored files/folders', implode(', ', $this->config->ignore_dirs));
     $info[] = array('Exakat version', Exakat::VERSION . ' ( Build ' . Exakat::BUILD . ') ');
     return $this->formatSimpleTable($info, $css);
 }