English 中文(简体)
Kohana config数据库
原标题:Kohana config database - enabling

我可以把工作推到“数据库”。

I m enabling new Config Source that way:

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

在装满模块之后,Im 装入该源,放在boot底部。 php档案。

当Im试图使这一秘密来源成为可能时,我就发现这一错误。

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261900 bytes) in /var/www/moje/modules/database/classes/kohana/config/database/writer.php on line 124 

Line 124 in file (.../)database/writer.php doesnt exists - it has only 111 lines.

什么是错的?

编辑:Kohana 3.2

问题回答

这种声音,如3.2张,我用了3.0张(后经3.1)。 这里是在科加纳论坛的座右铭:

http://forum.kohanaframework.org/discussion/9637/config_database-and-the-out-of-memory-error/p1

It s going because Kohana trying to load database settings from database (and it s going to recursion)

You should initialize your database instance before attaching Config_Database reader

Try this (in bootstrap.php, after Kohana::modules()):

Database::instance();

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

Or you can simply load database config right before adding the Config_Database

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




相关问题
Kohana - subfolders within views folder

I m working on the admin section of a site using Kohana. I ve created a "admin" subfolder within the views folder to store admin views. I m also using a modified instance of the Template Controller ...

approach for "site down for maintenance"

I have been using Joomla and I love its administrative facility to put the site down for maintenance. As I have seen, all requests to the site if it is in maintenance mode is routed to a single page. ...

Kohana 3: using maintainable routes

I m using Kohana v3 for a web project, and today I found myself writing this: echo Html::anchor( user/view/ .$user->id, "See user s profile"); If I rename the action_view method in the User ...

Is using a Mail Model in MVC incorrect?

I have built a model in some of my MVC websites to assist with sending emails, generally I do something like this $mail = new Mail_Model; $mail->to( me@somewhere.com ); $mail->from( you@...

help on building a basic php search engine

i looked for tutorials everywhere but just can t seem to get a good one... a search page with pagination, column header sorting, and multiple filtering(filters are in checkboxes) the problem: had ...

What s the proper MVC way to do this....?

Quick question about general MVC design principle in PHP, using CodeIgniter or Kohana (I m actually using Kohana). I m new to MVC and don t want to get this wrong... so I m wondering if i have ...

Kohana Error... Attempt to assign property of non-object

So I m trying to go through the Version 3 Guide of Kohana and keep getting an error on the hello world create view part. ErrorException [ Warning ]: Attempt to assign property of non-object Line 8: $...

热门标签