File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -20,19 +20,21 @@ function drufony_flush_caches() {
20
20
$paths[] = Drufony::getContainer()->getParameter('kernel.cache_dir');
21
21
}
22
22
23
- foreach ($paths as $path) {
24
- if (is_dir($path)) {
25
- $dir = dir($path);
26
- while (($entry = $dir->read()) !== FALSE) {
27
- if ($entry === '.' || $entry === '..') {
28
- continue;
23
+ register_shutdown_function(function ($paths) {
24
+ foreach ($paths as $path) {
25
+ if (is_dir($path)) {
26
+ $dir = dir($path);
27
+ while (($entry = $dir->read()) !== FALSE) {
28
+ if ($entry === '.' || $entry === '..') {
29
+ continue;
30
+ }
31
+ $entry_path = $dir->path . DIRECTORY_SEPARATOR . $entry;
32
+ file_unmanaged_delete_recursive($entry_path);
29
33
}
30
- $entry_path = $dir->path . DIRECTORY_SEPARATOR . $entry;
31
- file_unmanaged_delete_recursive($entry_path);
34
+ $dir->close();
32
35
}
33
- $dir->close();
34
36
}
35
- }
37
+ }, $paths);
36
38
return array();
37
39
}
38
40
@@ -54,4 +56,4 @@ if (!function_exists('composer_manager_register_autoloader')) {
54
56
function composer_manager_register_autoloader() {
55
57
require_once DRUPAL_ROOT . '/../vendor/autoload.php';
56
58
}
57
- }
59
+ }
You can’t perform that action at this time.
0 commit comments