Przeglądaj źródła

Delete apc_delete_file()

Visman 1 rok temu
rodzic
commit
baaecfcea7

+ 0 - 2
app/Core/Cache/FileCache.php

@@ -226,8 +226,6 @@ class FileCache implements CacheInterface
     {
         if (\function_exists('\\opcache_invalidate')) {
             \opcache_invalidate($file, true);
-        } elseif (\function_exists('\\apc_delete_file')) {
-            \apc_delete_file($file);
         }
     }
 

+ 0 - 2
app/Models/BBCodeList/BBCodeList.php

@@ -66,8 +66,6 @@ class BBCodeList extends Model
     {
         if (\function_exists('\\opcache_invalidate')) {
             \opcache_invalidate($this->fileCache, true);
-        } elseif (\function_exists('\\apc_delete_file')) {
-            \apc_delete_file($this->fileCache);
         }
 
         return $this;

+ 18 - 16
app/Models/Extension/Extensions.php

@@ -168,24 +168,28 @@ class Extensions extends Manager
         $result = [];
 
         foreach ($files as $path => $file) {
+            $context = null;
+
             if (! \is_array($file)) {
-                continue;
+                $context = [
+                    'errors' => ['Bad json'],
+                ];
             } elseif (! $v->validation($file)) {
-                $this->c->Log->debug(
-                    'Extension: Bad structure for '
-                    . \preg_replace('%^.+((?:[\\\\/]+[^\\\\/]+){3})$%', '$1', $path),
-                    [
-                        'errors'  => \array_map('\\ForkBB\__', $v->getErrorsWithoutType()),
-                        'headers' => false,
-                    ]
-                );
-
-                continue;
+                $context = [
+                    'errors' => \array_map('\\ForkBB\__', $v->getErrorsWithoutType()),
+                ];
             }
 
-            $data             = $v->getData(true);
-            $data['path']     = $path;
-            $result[$v->name] = $data;
+            if (null === $context) {
+                $data             = $v->getData(true);
+                $data['path']     = $path;
+                $result[$v->name] = $data;
+            } else {
+                $context['headers'] = false;
+                $path               = \preg_replace('%^.+((?:[\\\\/]+[^\\\\/]+){3})$%', '$1', $path);
+
+                $this->c->Log->debug("Extension: Bad structure for {$path}", $context);
+            }
         }
 
         return $result;
@@ -480,8 +484,6 @@ class Extensions extends Manager
         } else {
             if (\function_exists('\\opcache_invalidate')) {
                 \opcache_invalidate($file, true);
-            } elseif (\function_exists('\\apc_delete_file')) {
-                \apc_delete_file($file);
             }
 
             return true;