简体   繁体   中英

MongoDB in Kohana 3

I wrote a Mongo_Model to use inside kohana and felt pretty snappy about it until I tried getting anything working with it. The problem is the Kohana's Model class does many things for me that I don't want it to, such as creating a default database (and thus crashes my app). So how do I go about truly implementing my mongo model in Kohana? How do I disable the default database and Just use my model to handle everything with mongo? or the other way around, how do I change kohana's code to acknowledge me using mongo? I just don't want to stick my fingers where they don't belong (eg Kohana's system folder) and I want this to be as clean as possible. Any suggestions?

Thank you!

You don't have to extend the Model class from your Mongo_Model class. The base model class is there in case you wish to use Kohana's database library.

There is a project for Kohana that implements MongoDB: https://github.com/colinmollenhour/mongodb-php-odm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM