0

I have no clue why but the database config writter doesn't seem to work.

I've already enabled the database module and attached the driver in boostrap.php:

Kohana::$config->attach(new Config_File);
Kohana::$config->attach(new Config_Database, FALSE);

When i call the writter

Kohana::$config->write('group', 'key', 'value');

it just throws an ugly exception:

ErrorException [ Fatal Error ]: Call to undefined method Config::write()

I've created the database table and loading config works fine when I manually insert data into the database.

note: I'm using kohana 3.2.2 with the built in database module.

4

1 回答 1

0

我猜抛出异常是因为Config_File,它是一个读者而不是一个作家(见http://kohanaframework.org/3.2/guide/api/Config_File)。

尝试Kohana::$config->attach(new Config_File);在您的引导程序中删除。

于 2013-03-01T14:30:01.497 回答