Skip to content

Commit

Permalink
Merge pull request #1137 from m038/CS-5790
Browse files Browse the repository at this point in the history
CS-5790: Fixes issue when images/files/videos/pdf folder is symlink
  • Loading branch information
Paweł Mikołajczuk committed May 22, 2015
2 parents 213d038 + 49c5d01 commit b670a03
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions newscoop/bin/newscoop-restore
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ if ($backupVersion < 3) {
$configSrcDir = "$tempDirName/conf/database_conf.php";
}

$fileSrcDir = "$tempDirName/files";
$imagesSrcDir = "$tempDirName/images";
$videosSrcDir = "$tempDirName/videos";
$pdfSrcDir = "$tempDirName/pdf";
$fileSrcDir = "$tempDirName/files/.";
$imagesSrcDir = "$tempDirName/images/.";
$videosSrcDir = "$tempDirName/videos/.";
$pdfSrcDir = "$tempDirName/pdf/.";
$configDestDir = $ETC_DIR;
$filesDestDir = $CAMPSITE_DIR.'/public/files';
$imagesDestDir = $CAMPSITE_DIR.'/images';
Expand Down Expand Up @@ -492,29 +492,29 @@ echo "done.\n";
echo " * Restoring images...";
flush_output($flush);
if (is_dir($imagesSrcDir)) {
camp_copy_files($imagesSrcDir, $CAMPSITE_DIR);
camp_copy_files($imagesSrcDir, $imagesDestDir);
}
echo "done.\n";

echo " * Restoring videos...";
flush_output($flush);
if (is_dir($videosSrcDir)) {
camp_copy_files($videosSrcDir, $destination);
camp_copy_files($videosSrcDir, $videosDestDir);
}
echo "done.\n";

echo " * Restoring file attachments...";
flush_output($flush);
if (is_dir($fileSrcDir)) {
camp_copy_files($fileSrcDir, $destination);
camp_copy_files($fileSrcDir, $filesDestDir);
}
echo "done.\n";
//flush_output($flush);

echo " * Restoring PDFs...";
flush_output($flush);
if (is_dir($pdfSrcDir)) {
camp_copy_files($pdfSrcDir, $destination);
camp_copy_files($pdfSrcDir, $pdfDir);
}

echo "done.\n";
Expand Down Expand Up @@ -612,7 +612,7 @@ echo "done.\n";

if ($convertToUTF) {
echo " * Converting the database from '$fromCharset' to 'UTF-8'...\n";

$dumpFile = "$tempDirName/$destDbName-database-$fromCharset.sql";
if (camp_backup_database($destDbName, $dumpFile, $output,
array("--default-character-set=$fromCharset")) != 0) {
Expand All @@ -624,7 +624,7 @@ echo "done.\n";
camp_restore_database($outDumpFile);
unlink($dumpFile);
unlink($outDumpFile);

echo " done.\n";
}
//}
Expand Down

0 comments on commit b670a03

Please sign in to comment.