首页 > 解决方案 > 在 laravel 5.8 中创建自定义缓存驱动器给出错误“不支持驱动程序 [aerospike]。”

问题描述

我想使用 aerospike 创建一个自定义缓存驱动程序。

我已按照文档中的说明进行操作:

https://laravel.com/docs/5.8/cache#adding-custom-cache-drivers

Cache::extend('aerospike', function ($app) {
            $config = $app['config'];
            $server = $config['cache.stores.aerospike.servers'];

            $aerospike = new \Aerospike($server);

            $store = new AerospikeStore($aerospike, $config['cache.prefix'], $config['cache.stores.aerospike.namespace']);

            return Cache::repository($store);
        });

还创建了 AerospikeStore 文件。

运行php artisan serve 时它总是说:

在 CacheManager.php 第 109 行:
不支持驱动程序 [aerospike]。

标签: laravel-5aerospike

解决方案


推荐阅读