]> _ Git - cubist_util.git/commitdiff
wait #6968 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jun 2024 07:31:25 +0000 (09:31 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jun 2024 07:31:25 +0000 (09:31 +0200)
src/Files/Files.php
src/Files/VirtualDirectory.php

index a7a0ae4a999921cf7e781b4a3b9c39d99a45c918..619d7ff600241bcacdd1471109a7708eea2ff8f8 100644 (file)
@@ -83,22 +83,19 @@ class Files
         return new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, $exclude), $mode);
     }
 
-    public static function listFilesOfDirectory($path, &$res = [])
+    public static function listFilesOfDirectory($path, &$res)
     {
         $files = scandir($path);
 
-        foreach ($files as $key => $value) {
-            $path = realpath($path . DIRECTORY_SEPARATOR . $value);
-            if (!is_dir($path)) {
-                $res[] = $path;
+        foreach ($files as $value) {
+            $p = realpath($path . DIRECTORY_SEPARATOR . $value);
+            if (!is_dir($p)) {
+                $res[] = $p;
             } else if ($value != "." && $value != "..") {
-                static::listFilesOfDirectory($path, $res);
-                $res[] = $path;
+                static::listFilesOfDirectory($p, $res);
             }
         }
-
         return $res;
-
     }
 
     /**
index 9b8157366a11c5dae442c5ab1ca9be7052f5b550..e5b971e30cbae98ed26d69cb8217e171358d03a0 100644 (file)
@@ -185,11 +185,6 @@ class VirtualDirectory
         $from = realpath($from);
         Files::listFilesOfDirectory($from, $files);
 
-
-        if (!count($files)) {
-            dddd(`ls -l $from`);
-        }
-
         $relativeTo = $this->relativePath($to);
 
         $total = 0;