colinmollenhour / mongodb-php-odm

A simple but powerful set of wrappers for using MongoDb in PHP (also a Kohana 3 module)
BSD 3-Clause "New" or "Revised" License
208 stars 50 forks source link

Kohana::$environment-specific configuration #45

Closed sorcererlc closed 11 years ago

sorcererlc commented 11 years ago

Added all Kohana environments to config file. Updated Collection and Document classes to instantiate Database class using current Kohana environment.

Should make it easier to use in multi-environment applications.

colinmollenhour commented 11 years ago

Why not just set Mongo_Database::$default = Kohana::$environment in your bootstrap? I think this is better as it keeps the module more generic (not tied directly to Kohana or to any specific version of Kohana).

sorcererlc commented 11 years ago

You are correct, this is a better way if you want to keep the module as generic as possible.

I usually write my modules with deep Kohana integration and i try to make things as automated as possible. In this case, may i suggest setting up a separate branch for a more Kohana-integrated version of the module?

colinmollenhour commented 11 years ago

I've not used Kohana in years so honestly I don't want to invest any time into it.

sorcererlc commented 11 years ago

I understand. You should take a look at the latest version. A lot of things have changed/improved in the last two or so years :)