From: Vincent Vanwaelscappel Date: Tue, 29 Mar 2022 09:49:32 +0000 (+0200) Subject: wip #5184 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=933fc7939260747b60ed7d1fac160988ec59ecbb;p=cubist_util.git wip #5184 @0.5 --- diff --git a/src/Files/VirtualDirectory.php b/src/Files/VirtualDirectory.php index 918ccb3..81de604 100644 --- a/src/Files/VirtualDirectory.php +++ b/src/Files/VirtualDirectory.php @@ -118,7 +118,7 @@ class VirtualDirectory } $path = $file->getRealPath(); $dest = str_replace($from, '', $path); - if(!$path){ + if (!$path) { continue; } $this->copy($path, $this->relativePath($to) . '/' . ltrim($dest, '/')); @@ -133,7 +133,7 @@ class VirtualDirectory continue; } $path = $file->getRealPath(); - if (!isset($existing[$path])) { + if (!isset($existing[$path]) && file_exists($path)) { unlink($path); } } diff --git a/src/PHP.php b/src/PHP.php index fffb548..5ba0e15 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -17,6 +17,11 @@ class PHP } } + public static function memoryAllocate($amount) + { + ini_set("memory_limit", $amount); + } + /** * @param $file * @return mixed