From f6d19d265011bfd73a73f39c6bf8ea53b10475fa Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 24 Apr 2016 10:56:22 +0100 Subject: [PATCH] Don't move backups dir when updating --- lib/updater.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/updater.php b/lib/updater.php index 23e1a52..7e30451 100644 --- a/lib/updater.php +++ b/lib/updater.php @@ -20,10 +20,10 @@ function startUpdate() { echo 'Checking we can entirely move old ICEcoder version...
'; foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),RecursiveIteratorIterator::SELF_FIRST) as $item) { if (strpos($source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(),"oldVersion")==false) { - // Don't move plugins or .git away + // Don't move backups, plugins or .git away $testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(); $testPath = str_replace("\\","/",$testPath); - if (strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) { + if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) { if (!is_writeable($item)) { array_push($cantMoveArray,substr($item,count($source)+2)); } @@ -64,10 +64,10 @@ function copyOldVersion() { echo 'Moving current ICEcoder files...
'; foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),RecursiveIteratorIterator::SELF_FIRST) as $item) { if (strpos($source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(),"oldVersion")==false) { - // Don't move plugins or .git away + // Don't move backups, plugins or .git away $testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(); $testPath = str_replace("\\","/",$testPath); - if (strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) { + if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) { if ($item->isDir()) { mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0755); } else {