Tired of the limitations of Kohana's ORM? Want a proven, full-featured ORM to use in your Kohana projects? This module allows the Doctrine ORM to be used with Kohana.
This module comes with a sample database schema so you can test tables are generated. If you want to write all your own code, replace the contents of application/config/doctrine/schema/database.yml with your schema, and delete application/controllers/doctrine.php
vendor
http://svn.phpdoctrine.org/branches/0.11/lib$config['modules'] = array
(
MODPATH.'doctrine',
// Your existing modules listed here
);$config['enable_hooks'] = FALSE;and change it to
$config['enable_hooks'] = TRUE;modules/doctrine/hooks/doctrine.php
> doctrine
or on Windows
> C:\path\to\php.exe doctrine
And choose the command you want.Sorry, but I do not have the time to answer questions about using Doctrine (However my company offers support and consulting!). Please read the Doctrine manual or ask on the phpdoctrine mailing list.
If you encounter problems getting the integration to work or receive error messages from Kohana, please let me know.
This is something I thought about deeply before deciding to do it. As I see it, a module is self-contained code which should be independent of the current application. In the case of doctrine, this is the library, hook, and command-line interface.
The schema files, models and fixtures are application specific, therefore reside in the application directory.
This means that the module can be copied from one Kohana installation to another can not carry any application specific data with it. It does however mean the folders in application/config/doctrine have to be recreated each time.
I did post in the Kohana Forum before starting to see if my understanding of the separation between application and modules was correct but didn't receive much helpful feedback
Doctrine is under heavy development, and if I included it with this module it would always be out of date. Not including doctrine allows you to use a SVN checkout without having to delete doctrine first. The best way to get Doctrine is to download it directly from http://phpdoctrine.org. This way you will always get the latest version.
I use a SVN checkout of Doctrine (pinned to the 0.10 branch) so I get bug fixes whenever they're made, and I recommend you do the same.
Good question! I don't like them in a sub-directory, however if doctrine models went in the same directory as the Kohana models the command-line tools wouldn't work, as they expect to load and inspect all models when generating the SQL.
This code was created by Maple Design. We're a talented creative agency who build profitable web apps and provide Kohana development services to other agencies. Give us a call or email us - we'd be delighted to see how we can assist you.