mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 13:39:22 +03:00
Resolve #1533
This commit is contained in:
parent
a424c6a52a
commit
8e0303f065
3 changed files with 146 additions and 0 deletions
34
plugins/cache-apcu/index.php
Normal file
34
plugins/cache-apcu/index.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
class CacheAPCuPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
const
|
||||
NAME = 'Cache APCu',
|
||||
VERSION = '2.36',
|
||||
RELEASE = '2024-03-22',
|
||||
REQUIRED = '2.36.0',
|
||||
CATEGORY = 'Cache',
|
||||
DESCRIPTION = 'Cache handler using PHP APCu';
|
||||
|
||||
public function Init() : void
|
||||
{
|
||||
if (\MailSo\Base\Utils::FunctionsCallable(array('apcu_store', 'apcu_fetch', 'apcu_delete', 'apcu_clear_cache'))) {
|
||||
$this->addHook('main.fabrica', 'MainFabrica');
|
||||
}
|
||||
}
|
||||
|
||||
public function Supported() : string
|
||||
{
|
||||
return \MailSo\Base\Utils::FunctionsCallable(array('apcu_store', 'apcu_fetch', 'apcu_delete', 'apcu_clear_cache'))
|
||||
? ''
|
||||
: 'PHP APCu not installed';
|
||||
}
|
||||
|
||||
public function MainFabrica($sName, &$mResult)
|
||||
{
|
||||
if ('cache' == $sName) {
|
||||
require_once __DIR__ . '/APCU.php';
|
||||
$mResult = new \MailSo\Cache\Drivers\APCU;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue