Exemplo n.º 1
0
 /**
  * @dataProvider gitFileDP
  */
 public function testGitFile($a, $b, $c, $d)
 {
     $obj = new _VersionControl();
     $this->string($obj->gitPath($a, $b, $c))->isEqualTo($d);
 }
Exemplo n.º 2
0
use VCS\Git;
use VCS\Mercurial;
use VCS\Subversion;
foreach (Project::getRepositories() as $repo) {
    // Get the right locale for this repo
    $locale = Project::getLocaleInContext($page_locale, $repo);
    // We don't care about en-US
    if ($locale == 'en-US') {
        continue;
    }
    if (in_array($locale, Project::getRepositoryLocales($repo))) {
        $ref_locale = Project::getReferenceLocale($repo);
        // Get VCS data
        $repo_vcs = VersionControl::VCSRepoName($repo);
        $repo_path = $repo_vcs . '/' . $locale;
        switch (VersionControl::getVCS($repo)) {
            case 'hg':
                $vcs = new Mercurial(HG . $repo_path);
                break;
            case 'svn':
                $vcs = new Subversion(SVN . $repo_path);
                break;
            case 'git':
                $vcs = new Git(GIT . $repo_path);
                break;
        }
        // Extract, cache and store VCS data
        $cache_id = $repo_vcs . $locale . 'healthstatus2';
        if (!($stats = Cache::getKey($cache_id))) {
            /* generate data */
            $commits = $vcs->getCommits();