views:

270

answers:

1

I've been looking for a good PHP ORM tool to use, and I recently found a good ORM class in Kohana. It has a fairly good and simple ORM implementation. The problem is, the code is unreusable outside of the Kohana framework without a rewrite/refactor. It relies on the Kohana class loader and various framework loading strategies to even work in the first place. Further, the required classes aren't packaged into a single dependency directory, or even multiple directories.

When I do this rewrite, I intend to republish the code via sourceforge or something, and those guys can of course reuse it if they want. So, should I just package the fileset needed into one directory, and make the appropriate classes do a require_once on any dependant classes, and 2 should I stick with the original class names that are project dependent (like Kohana_exception) even though it is pretty much unrelated to the Kohana project as a whole?

A second option would be to write another classloader that is a simplified version of the Kohana Framework classloader, and only cares about the ORM related stuff...

+5  A: 

If you think what you are doing will be a marked improvement to the Kohana project you should make your changes and submit a patch to be considered by the project's maintainers. You probably aren't the first person to appreciate a part of their framework and component-izing their framework into smaller bits may be something you could help encourage by submitting a patch (though that will require much more time on your part to engineer).

It sounds like you are extracting a piece of their framework for independent use so it doesn't sound like you're forking at all, though I can imagine removing all of those dependencies may sure seem like a fork.

cfeduke
Agreed. Ask the maintainers of Kohana to join as a developer, with the aim of componetizing the ORM. Most likely, they'll be happy to get a helping hand.
troelskn