mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
Moved cache drivers outside core to extensions (plugins)
This commit is contained in:
parent
d5690fc579
commit
4fc04648cf
267 changed files with 39 additions and 64 deletions
|
@ -47,12 +47,12 @@ To setup MySQL as the DB, in Admin Panel, click `Contacts`, check `Enable contac
|
|||
|
||||
Click the `Test` button. If it turns green, MySQL is ready to be used for contacts.
|
||||
|
||||
To setup Redis for caching, in Admin Panel, click `Config`, update the following configuration options:
|
||||
To setup Redis for caching, in Admin Panel, click `Extensions`, update the following configuration options:
|
||||
|
||||
- `cache > enable`: yes
|
||||
- `cache > fast_cache_driver`: `redis`
|
||||
- `labs > fast_cache_redis_host`: `redis`
|
||||
- `labs > fast_cache_redis_port`: `6379`
|
||||
- `Cache Redis`: `install`
|
||||
- `Cache Redis`: `enable`
|
||||
- `Cache Redis > host`: `redis`
|
||||
- `Cache Redis > port`: `6379`
|
||||
|
||||
Redis caching is now enabled.
|
||||
|
||||
|
@ -83,12 +83,12 @@ To use PostgreSQL as the DB, in Admin Panel, click `Contacts`, check `Enable con
|
|||
|
||||
Click the `Test` button. If it turns green, PostgreSQL is ready to be used for contacts.
|
||||
|
||||
To setup Redis for caching, in Admin Panel, click `Config`, update the following configuration options:
|
||||
To setup Redis for caching, in Admin Panel, click `Extensions`, update the following configuration options:
|
||||
|
||||
- `cache > enable`: yes
|
||||
- `cache > fast_cache_driver`: `redis`
|
||||
- `labs > fast_cache_redis_host`: `redis`
|
||||
- `labs > fast_cache_redis_port`: `6379`
|
||||
- `Cache Redis`: `install`
|
||||
- `Cache Redis`: `enable`
|
||||
- `Cache Redis > host`: `redis`
|
||||
- `Cache Redis > port`: `6379`
|
||||
|
||||
Redis caching is now enabled.
|
||||
|
||||
|
|
|
@ -20,11 +20,12 @@ class APCU implements \MailSo\Cache\DriverInterface
|
|||
{
|
||||
private string $sKeyPrefix;
|
||||
|
||||
function __construct(string $sKeyPrefix = '')
|
||||
public function setPrefix(string $sKeyPrefix) : void
|
||||
{
|
||||
$sKeyPrefix = \rtrim(\trim($sKeyPrefix), '\\/');
|
||||
$this->sKeyPrefix = empty($sKeyPrefix)
|
||||
? $sKeyPrefix
|
||||
: \preg_replace('/[^a-zA-Z0-9_]/', '_', \rtrim(\trim($sKeyPrefix), '\\/')).'/';
|
||||
: \preg_replace('/[^a-zA-Z0-9_]/', '_', $sKeyPrefix).'/';
|
||||
}
|
||||
|
||||
public function Set(string $sKey, string $sValue) : bool
|
|
@ -27,7 +27,7 @@ class Memcache implements \MailSo\Cache\DriverInterface
|
|||
|
||||
private string $sKeyPrefix;
|
||||
|
||||
function __construct(string $sHost = '127.0.0.1', int $iPort = 11211, int $iExpire = 43200, string $sKeyPrefix = '')
|
||||
function __construct(string $sHost = '127.0.0.1', int $iPort = 11211, int $iExpire = 43200)
|
||||
{
|
||||
$this->iExpire = 0 < $iExpire ? $iExpire : 43200;
|
||||
|
||||
|
@ -35,10 +35,14 @@ class Memcache implements \MailSo\Cache\DriverInterface
|
|||
if (!$this->oMem->addServer($sHost, \strpos($sHost, ':/') ? 0 : $iPort)) {
|
||||
$this->oMem = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function setPrefix(string $sKeyPrefix) : void
|
||||
{
|
||||
$sKeyPrefix = \rtrim(\trim($sKeyPrefix), '\\/');
|
||||
$this->sKeyPrefix = empty($sKeyPrefix)
|
||||
? $sKeyPrefix
|
||||
: \preg_replace('/[^a-zA-Z0-9_]/', '_', \rtrim(\trim($this->sKeyPrefix), '\\/')) . '/';
|
||||
: \preg_replace('/[^a-zA-Z0-9_]/', '_', $sKeyPrefix).'/';
|
||||
}
|
||||
|
||||
public function Set(string $sKey, string $sValue) : bool
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue