mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-18 21:48:24 -04:00
make OPcache optional, resolves #1678
This commit is contained in:
@@ -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) . ';'
|
||||
|
||||
Reference in New Issue
Block a user