mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-01-23 02:35:23 +00:00
make OPcache optional, resolves #1678
This commit is contained in:
parent
a5d71d855f
commit
60bab2badb
2 changed files with 7 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ for more information.
|
|||
### Optional Requirements
|
||||
|
||||
- PHP with GD extension (when using identicon or vizhash icons, jdenticon works
|
||||
without it)
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -269,7 +269,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) . ';'
|
||||
|
|
@ -281,7 +283,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) . ';'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue