]> _ Git - cubist_util.git/commitdiff
wip #5184 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 09:49:32 +0000 (11:49 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 09:49:32 +0000 (11:49 +0200)
src/Files/VirtualDirectory.php
src/PHP.php

index 918ccb3863b02680c51bcaf4a8ce0d7a3e072af7..81de6042a5aa164ad2464b79addc46712fb65209 100644 (file)
@@ -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);
             }
         }
index fffb548577ebca2277dc5ba655c8dcd30f8f6778..5ba0e153efbe795c14e8c958fbb6e62015b958e2 100644 (file)
@@ -17,6 +17,11 @@ class PHP
         }
     }
 
+    public static function memoryAllocate($amount)
+    {
+        ini_set("memory_limit", $amount);
+    }
+
     /**
      * @param $file
      * @return mixed