我有一个缓存模块配置的问题。Kohana缓存模块不加载设置服务器(kohana 3.2)
我也做了以下内容:
把
Cache::$default
= 'memcachetag';在bootstrap.php中复制的模块/高速缓存/配置/ config.php中使用以下的配置应用/配置/ config.php中:
return array( // Override the default configuration 'memcachetag' => array( 'driver' => 'memcachetag', // Use Memcached as the default driver 'default_expire' => 8000, // Overide default expiry 'servers' => array( // Add a new server array( 'host' => 'server', 'port' => 11211, 'persistent' => FALSE ) ), 'compression' => FALSE ) );
的问题是 '服务器' 是没有被覆盖所以它总是从模块的配置文件中拉(主机名始终是本地主机)
我做一个实例与Cache::instance()
,并与回声Debug::vars(Cache::instance());
提前致谢!
对不起,我在我的文章中犯了一个错误,我确实在modules/application/config.php中设置了它,我可以更改'default_expire'=> 8000等值,并且它们显示已更改,但是当我更改服务器值被忽略,并使用本地主机 – Ian
一些更多的信息 当我在modules/cache/config/cache.php中添加服务器它工作正常(我编辑了memcacetag配置数组) 当我做回声Devug :: vars (Kohana :: $ config-> load(cache)我没有看到我添加的服务器,我只看到localhost – Ian
尽管如此,配置文件不应该在'modules/application/config.php'中,它们应该在'application/config/cache.php'。我不知道你的应用程序文件夹在哪里,但现在它不会重载模块的值乐。 – Luwe