我正在尝试做的是在 larval 之外将 memcached 与 larvae 的数据库库一起使用,这就是我所拥有的,但我无法让 memcache 驱动程序工作
$capsule = new Capsule();
$k2Config = include(dirname(dirname(__FILE__)) . '/Config/k2.php');
$unitConfig = array(
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => ''
);
$capsule->addConnection($config);
$capsule->addConnection($k2Config, 'k2');
$capsule->addConnection($unitConfig, 'uTest');
$capsule->setAsGlobal();
// Setup cache
$container = $capsule->getContainer();
$container = new Container();
$cacheManager = new CacheManager($container);
$cacheManager->driver('memcached');
$capsule->setCacheManager($cacheManager);
return $capsule->connection();