function updateRepositoryList ($params) {
$groups = $this->getGroups () ;
- $dir = '/var/lib/gforge/plugins/scmbzr/public-repositories' ;
+ $dir = forge_get_config('data_path').'/plugins/scmbzr/public-repositories' ;
+
+ if (!is_dir($dir)) {
+ mkdir ($dir, 0644, true);
+ }
$oldlist = array () ;
$dh = opendir ($dir) ;
}
if (! $project->enableAnonSCM()) {
- unlink ($snapshot) ;
- unlink ($tarball) ;
+ if (file_exists ($snapshot)) unlink ($snapshot) ;
+ if (file_exists ($tarball)) unlink ($tarball) ;
return false;
}
$repo = $toprepo . '/' . $project->getUnixName() ;
if (!is_dir ($repo) || !is_file ("$repo/format")) {
- unlink ($snapshot) ;
- unlink ($tarball) ;
+ if (file_exists ($snapshot)) unlink ($snapshot) ;
+ if (file_exists ($tarball)) unlink ($tarball) ;
return false ;
}