Prechádzať zdrojové kódy

make OPcache optional, resolves #1678

El RIDO 9 mesiacov pred
rodič
commit
530f360497
2 zmenil súbory, kde vykonal 20 pridanie a 8 odobranie
  1. 14 6
      doc/Installation.md
  2. 6 2
      lib/Data/Filesystem.php

+ 14 - 6
doc/Installation.md

@@ -22,12 +22,20 @@ for more information.
 ### Minimal Requirements
 
 - PHP version 7.3 or above
-- GD extension (when using identicon or vizhash icons, jdenticon works without it)
-- zlib extension
-- some disk space or a database supported by [PDO](https://php.net/manual/book.pdo.php)
-- ability to create files and folders in the installation directory and the PATH
-  defined in index.php
-- A web browser with JavaScript and (optional) WebAssembly support
+- PHP with zlib extension
+- some disk space and the capability to create files and folders in the
+  installation directory and the `PATH` defined in index.php
+- A web browser with JavaScript support enabled
+
+### Optional Requirements
+
+- PHP with GD extension (when using identicon or vizhash icons, jdenticon works
+  without it) and OPcache (for better performance)
+- a database supported by [PHP PDO](https://php.net/manual/book.pdo.php) and the
+  PHP PDO extension (when using database storage)
+- a Ceph cluster with Rados gateway or AWS S3 storage (when using S3 storage)
+- Google Cloud Storage (when using GCP storage)
+- A web browser with WebAssembly support
 
 ## Hardening and Security
 

+ 6 - 2
lib/Data/Filesystem.php

@@ -274,7 +274,9 @@ class Filesystem extends AbstractData
     {
         switch ($namespace) {
             case 'purge_limiter':
-                opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php');
+                if (function_exists('opcache_invalidate')) {
+                    opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php');
+                }
                 return $this->_storeString(
                     $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php',
                     '<?php' . PHP_EOL . '$GLOBALS[\'purge_limiter\'] = ' . var_export($value, true) . ';'
@@ -286,7 +288,9 @@ class Filesystem extends AbstractData
                 );
             case 'traffic_limiter':
                 $this->_last_cache[$key] = $value;
-                opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php');
+                if (function_exists('opcache_invalidate')) {
+                    opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php');
+                }
                 return $this->_storeString(
                     $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php',
                     '<?php' . PHP_EOL . '$GLOBALS[\'traffic_limiter\'] = ' . var_export($this->_last_cache, true) . ';'