Don't move backups dir when updating

This commit is contained in:
Matt Pass
2016-04-24 10:56:22 +01:00
parent 22bca280f5
commit f6d19d2650

View File

@@ -20,10 +20,10 @@ function startUpdate() {
echo 'Checking we can entirely move old ICEcoder version...<br>';
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...<br>';
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 {