Restructured one more time to be as SCM independent as possible.
The work is delegated as much as possible to the IDF_Scm_* classes.
This commit is contained in:
@@ -35,15 +35,10 @@ class IDF_Scm
|
||||
public static function get($request=null)
|
||||
{
|
||||
// Get scm type from project conf ; defaults to git
|
||||
switch ($request->conf->getVal('scm', 'git')) {
|
||||
case 'svn':
|
||||
return new IDF_Scm_Svn($request->conf->getVal('svn_repository'),
|
||||
$request->conf->getVal('svn_username'),
|
||||
$request->conf->getVal('svn_password'));
|
||||
case 'git':
|
||||
default:
|
||||
return new IDF_Scm_Git($request->project->getGitRepository());
|
||||
}
|
||||
$scm = $request->conf->getVal('scm', 'git');
|
||||
$scms = Pluf::f('allowed_scm');
|
||||
return call_user_func(array($scms[$scm], 'factory'),
|
||||
$request->project);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user