diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index 528a46eb03..d961035bd4 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -12,10 +12,11 @@ class scm */ public function setEngine($repo) { - $className = strtolower($repo->SCM) . 'Repo'; - if($repo->SCM == 'Git') $repo->SCM = 'GitRepo'; - if(!class_exists($className)) require(strtolower($repo->SCM) . '.class.php'); - $this->engine = new $className($repo->client, in_array($repo->SCM, array('Gitlab', 'GitFox')) ? $repo->apiPath : $repo->path, $repo->account, $repo->password, $repo->encoding, $repo); + $scm = strtolower($repo->SCM); + $className = $scm . 'Repo'; + if($scm == 'git') $scm = 'gitrepo'; + if(!class_exists($className)) require($scm . '.class.php'); + $this->engine = new $className($repo->client, in_array($scm, array('gitlab', 'gitfox')) ? $repo->apiPath : $repo->path, $repo->account, $repo->password, $repo->encoding, $repo); } /**