Maurits van der Schee 5 years ago
parent
commit
279586d8f7
2 changed files with 8 additions and 8 deletions
  1. 4
    4
      api.php
  2. 4
    4
      src/Tqdev/PhpCrudApi/Cache/TempFileCache.php

+ 4
- 4
api.php View File

@@ -3515,18 +3515,18 @@ namespace Tqdev\PhpCrudApi\Cache {
3515 3515
                     if (strlen($entry) != $len) {
3516 3516
                         continue;
3517 3517
                     }
3518
-                    if (is_file($filename)) {
3518
+                    if (file_exists($filename) && is_file($filename)) {
3519 3519
                         if ($all || $this->getString($filename) == null) {
3520
-                            unlink($filename);
3520
+                            @unlink($filename);
3521 3521
                         }
3522 3522
                     }
3523 3523
                 } else {
3524 3524
                     if (strlen($entry) != $segments[0]) {
3525 3525
                         continue;
3526 3526
                     }
3527
-                    if (is_dir($filename)) {
3527
+                    if (file_exists($filename) && is_dir($filename)) {
3528 3528
                         $this->clean($filename, array_slice($segments, 1), $len - $segments[0], $all);
3529
-                        rmdir($filename);
3529
+                        @rmdir($filename);
3530 3530
                     }
3531 3531
                 }
3532 3532
             }

+ 4
- 4
src/Tqdev/PhpCrudApi/Cache/TempFileCache.php View File

@@ -121,18 +121,18 @@ class TempFileCache implements Cache
121 121
                 if (strlen($entry) != $len) {
122 122
                     continue;
123 123
                 }
124
-                if (is_file($filename)) {
124
+                if (file_exists($filename) && is_file($filename)) {
125 125
                     if ($all || $this->getString($filename) == null) {
126
-                        unlink($filename);
126
+                        @unlink($filename);
127 127
                     }
128 128
                 }
129 129
             } else {
130 130
                 if (strlen($entry) != $segments[0]) {
131 131
                     continue;
132 132
                 }
133
-                if (is_dir($filename)) {
133
+                if (file_exists($filename) && is_dir($filename)) {
134 134
                     $this->clean($filename, array_slice($segments, 1), $len - $segments[0], $all);
135
-                    rmdir($filename);
135
+                    @rmdir($filename);
136 136
                 }
137 137
             }
138 138
         }

Loading…
Cancel
Save