Skip to content

Commit

Permalink
Dev Changes for the updater
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@7639 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Sep 15, 2009
1 parent 516eb69 commit 93430e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 16 additions & 7 deletions admin/update/updater.php
Expand Up @@ -259,9 +259,12 @@ function UpdateStep4()

$error=$http->Open($arguments);
$error=$http->SendRequest($arguments);
$error=$http->ReadReplyHeaders($headers);

if($error=="") {
$http->ReadReplyHeaders($headers);
if ($headers['content-type']=='text/html')
{
unlink($tempdir.'/update.zip');
}
elseif($error=='') {
$body=''; $full_body='';
for(;;){
$error = $http->ReadReplyBody($body,10000);
Expand Down Expand Up @@ -292,10 +295,16 @@ function UpdateStep4()
}

//Now unzip the new files over the existing ones.
$archive = new PclZip($tempdir.'/update.zip');
if ($archive->extract(PCLZIP_OPT_PATH, $rootdir)== 0) {
die("Error : ".$archive->errorInfo(true));
}
if (file_exists($tempdir.'/update.zip')){
$archive = new PclZip($tempdir.'/update.zip');
if ($archive->extract(PCLZIP_OPT_PATH, $rootdir)== 0) {
die("Error : ".$archive->errorInfo(true));
}
}
else
{
$output.=$clang->gT('There was a problem downloading the update file. Please try to restart the update process.').'<br />';
}



Expand Down
4 changes: 2 additions & 2 deletions common.php
Expand Up @@ -6547,7 +6547,7 @@ function rmdirr($dirname)

// Simple delete for a file
if (is_file($dirname) || is_link($dirname)) {
return unlink($dirname);
return @unlink($dirname);
}

// Loop through the folder
Expand All @@ -6564,5 +6564,5 @@ function rmdirr($dirname)

// Clean up
$dir->close();
return rmdir($dirname);
return @rmdir($dirname);
}

0 comments on commit 93430e0

Please sign in to comment.