Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / isolation / src / FSUtils.php
diff --git a/vendor/drush/drush/isolation/src/FSUtils.php b/vendor/drush/drush/isolation/src/FSUtils.php
new file mode 100644 (file)
index 0000000..33a244b
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+namespace Drush;
+
+// We want to avoid using symfony/filesystem in the isolation tests.
+trait FSUtils
+{
+    function removeDir($dir)
+    {
+        $files = array_diff(scandir($dir), ['.','..']);
+        foreach ($files as $file) {
+            if (is_dir("$dir/$file") && !is_link("$dir/$file")) {
+                $this->removeDir("$dir/$file");
+            } else {
+                unlink("$dir/$file");
+            }
+        }
+        return rmdir($dir);
+    }
+}