remove configurable dir for traffic & purge limiters

This commit is contained in:
El RIDO
2021-06-08 06:37:27 +02:00
parent ae486d651b
commit 3429d293d3
11 changed files with 2 additions and 24 deletions

View File

@@ -80,13 +80,11 @@ class Configuration
'traffic' => array(
'limit' => 10,
'header' => null,
'dir' => 'data',
'exemptedIp' => null,
),
'purge' => array(
'limit' => 300,
'batchsize' => 10,
'dir' => 'data',
),
'model' => array(
'class' => 'Filesystem',

View File

@@ -162,7 +162,6 @@ class Controller
$this->_model = new Model($this->_conf);
$this->_request = new Request;
$this->_urlBase = $this->_request->getRequestUri();
ServerSalt::setPath($this->_conf->getKey('dir', 'traffic'));
// set default language
$lang = $this->_conf->getKey('languagedefault');

View File

@@ -52,7 +52,6 @@ class PurgeLimiter extends AbstractPersistence
public static function setConfiguration(Configuration $conf)
{
self::setLimit($conf->getKey('limit', 'purge'));
self::setPath($conf->getKey('dir', 'purge'));
}
/**
@@ -71,7 +70,7 @@ class PurgeLimiter extends AbstractPersistence
}
$now = time();
$pl = (int) self::$_store->getValue('purge_limiter');
$pl = (int) self::$_store->getValue('purge_limiter');
if ($pl + self::$_limit >= $now) {
return false;
}

View File

@@ -85,7 +85,6 @@ class TrafficLimiter extends AbstractPersistence
public static function setConfiguration(Configuration $conf)
{
self::setLimit($conf->getKey('limit', 'traffic'));
self::setPath($conf->getKey('dir', 'traffic'));
self::setExemptedIp($conf->getKey('exemptedIp', 'traffic'));
if (($option = $conf->getKey('header', 'traffic')) !== null) {