We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ae74eb commit a14e293Copy full SHA for a14e293
ext/opcache/tests/cleanup_helper.inc
@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+function removeDirRecursive($dir) {
4
+ if (!is_dir($dir)) return;
5
+ try {
6
+ $iterator = new RecursiveIteratorIterator(
7
+ new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),
8
+ RecursiveIteratorIterator::CHILD_FIRST
9
+ );
10
+ foreach ($iterator as $fileinfo) {
11
+ if ($fileinfo->isDir()) {
12
+ @rmdir($fileinfo->getRealPath());
13
+ } else {
14
+ @unlink($fileinfo->getRealPath());
15
+ }
16
17
+ @rmdir($dir);
18
+ } catch (UnexpectedValueException $e) { @rmdir($dir); } catch (Exception $e) { @rmdir($dir); }
19
+}
0 commit comments