Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在kohana 3.3中将默认组设置为缓存_Php_Caching_Kohana - Fatal编程技术网

Php 在kohana 3.3中将默认组设置为缓存

Php 在kohana 3.3中将默认组设置为缓存,php,caching,kohana,Php,Caching,Kohana,将Kohana framework从3.2升级到3.3后,Cache要求我为其添加一个默认组 config/cache.php 以前,我经常这样做,但没有组名: Cache::instance()->set('key', 'val'); 现在,它发送了一个异常:未能加载Kohana缓存组:文件 但是,当我设置名称组时,所有炒菜都完美无瑕 Cache::instance('default')->set('key', 'val'); 如何在3.3中设置一个默认组而不总是键入我想使用的

将Kohana framework从3.2升级到3.3后,Cache要求我为其添加一个默认组

config/cache.php

以前,我经常这样做,但没有组名:

Cache::instance()->set('key', 'val');
现在,它发送了一个异常:未能加载Kohana缓存组:文件

但是,当我设置名称组时,所有炒菜都完美无瑕

Cache::instance('default')->set('key', 'val');
如何在3.3中设置一个默认组而不总是键入我想使用的内容?也许是一个新的升级,但是,我检查了kohana 3.3的新功能,我没有看到任何这些


希望你能帮助我。

好吧,就这么定了。如果未提供缓存组,则默认为文件。所以,如果你敢改变这一点,请便。但是只需在bootstrap.php中设置静态实例,在底部回答

-这是来自基本缓存类-

public static $default = 'file';

public static function instance($group = NULL)
{
    // If there is no group supplied
    if ($group === NULL)
    {
        // Use the default setting
        $group = Cache::$default;
    }
因此,在bootstrap.php中设置此选项,尽管我会在配置中将其命名为APC:

Cache::$default = 'default';

好吧,就这样吧。如果未提供缓存组,则默认为文件。所以,如果你敢改变这一点,请便。但是只需在bootstrap.php中设置静态实例,在底部回答

-这是来自基本缓存类-

public static $default = 'file';

public static function instance($group = NULL)
{
    // If there is no group supplied
    if ($group === NULL)
    {
        // Use the default setting
        $group = Cache::$default;
    }
因此,在bootstrap.php中设置此选项,尽管我会在配置中将其命名为APC:

Cache::$default = 'default';

@以西奎亚真我pleasure@EzequielVillarreal我的荣幸