fixed some wrong uses of
This commit is contained in:
parent
bae3f6aec0
commit
945fb1ca9a
@ -45,7 +45,7 @@ class CodeRepoModel extends Model
|
||||
if (self::_deleteDirectory($dir . "/" . $item) === FALSE)
|
||||
{
|
||||
chmod($dir . "/" . $item, 0777);
|
||||
if (self::deleteDirectory($dir . "/" . $item) === FALSE) return FALSE;
|
||||
if (self::_deleteDirectory($dir . "/" . $item) === FALSE) return FALSE;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
$CI = &get_instance();
|
||||
$CI->load->model('CodeRepoModel');
|
||||
|
||||
class GitModel extends CodeRepoModel
|
||||
class SubversionModel extends CodeRepoModel
|
||||
{
|
||||
function __construct ()
|
||||
{
|
||||
@ -156,12 +156,20 @@ class GitModel extends CodeRepoModel
|
||||
static function createRepo ($projectid, $repodir, $cfgdir, $api)
|
||||
{
|
||||
$projdir = "{$repodir}/{$projectid}";
|
||||
if (@git_repository_init($projdir, TRUE) === FALSE) return FALSE;
|
||||
try
|
||||
{
|
||||
@Git2\Repository::init($projdir, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
catch (Exception $x)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static function deleteRepo ($projectid, $repodir)
|
||||
{
|
||||
return $this->deleteDirectory("{$repodir}/{$projectid}");
|
||||
return self::_deleteDirectory("{$repodir}/{$projectid}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2223,13 +2223,13 @@ class SubversionModel extends CodeRepoModel
|
||||
$contents = @file_get_contents("{$cfgdir}/${hook}");
|
||||
if ($contents === FALSE)
|
||||
{
|
||||
$this->deleteDirectory ($projdir);
|
||||
self::_deleteDirectory ($projdir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (@file_put_contents("{$repodir}/${hook}", str_replace('%API%', $api, $contents)) === FALSE)
|
||||
{
|
||||
$this->deleteDirectory ($projdir);
|
||||
self::_deleteDirectory ($projdir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -2237,7 +2237,7 @@ class SubversionModel extends CodeRepoModel
|
||||
if (@chmod("{$repodir}/{$hook}", 0755) === FALSE ||
|
||||
@symlink("../../{$hook}", "{$repodir}/{$projectid}/hooks/${hook}") === FALSE)
|
||||
{
|
||||
$this->deleteDirectory ($projdir);
|
||||
self::_deleteDirectory ($projdir);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user