changed log messages and added another ZipArchive availablity check

This commit is contained in:
hyung-hwan 2015-04-14 05:34:28 +00:00
parent 39ca68b8ad
commit 6c03fe0bb4
2 changed files with 10 additions and 3 deletions

View File

@ -665,7 +665,7 @@ class Code extends Controller
if ($file === FALSE)
{
$data['project'] = $project;
$data['message'] = "Failed to get a file - $path";
$data['message'] = "Failed to get a file";
$this->load->view ($this->VIEW_ERROR, $data);
}
else if ($file['type'] == 'file')
@ -700,7 +700,7 @@ class Code extends Controller
if ($filename === FALSE)
{
$data['project'] = $project;
$data['message'] = "Failed to zip a directory for $path";
$data['message'] = "Failed to zip a directory";
$this->load->view ($this->VIEW_ERROR, $data);
}
else

View File

@ -1002,6 +1002,11 @@ class SubversionModel extends Model
function zipSubdir ($projectid, $path, $rev, $topdir)
{
// codepot_zip_dir() uses ZipArchive. Check if the class
// exists not to perform any intermediate steps when it's
// not available.
if (!class_exists('ZipArchive')) return FALSE;
$orgurl = 'file://'.$this->_canonical_path(CODEPOT_SVNREPO_DIR."/{$projectid}/{$path}");
$workurl = ($path == '')? $orgurl: "{$orgurl}@"; // trailing @ for collision prevention
@ -1050,7 +1055,9 @@ class SubversionModel extends Model
return FALSE;
}
//codepot_delete_files ($actual_tfname, TRUE); // delete the directory in case it exists
// temporary files are not deleted here.
// the caller must clear temporary files.
return $tfname;
}
}