<?php
declare(strict_types=1);
namespace app\bootstrap;
use support\Cache;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;
class FilesystemCache
{
public static function start($worker): void
{
Cache::$instance = new Psr16Cache(new FilesystemAdapter(
directory: runtime_path('cache'),
));
}
}
app/bootstrap/FilesystemCache.php
config/bootstrap.php
谢谢大佬,非常感谢,已经OK
回头我加个配置
哈哈~~ 那更好了,紧随大佬脚步 ~
增加了file和array驱动
老用户需要升级webman-framework,自行创建 config/cache.php
参考文档 https://www.workerman.net/doc/webman/db/cache.html
哈哈~~ 大佬高效率,赞!