<p>In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files?</p>

<p>Update:</p>

<p>I jumped in and started looking at the ORM source code.. One thing was immediately confusing to me.. all the ORM classes have the class name appended with _CORE i.e. ORM_Core ORM_Iterator_Core, but the code everywhere is extending the ORM class. Problem is, I've searched the whole code base 6 different ways, and I've never seen a plain ORM class def nor an ORM interface def or anything.. Could someone enlighten me on where that magic happens?</p>

It turns out that Kohana uses magic class loading so that if a defined class with an _Core extention doesn't exist as a class
i.e. ORM_Core exists, but ORM doesn't, so Kohana will magically define an ORM class
Since the package uses 100% magic class loading.
In case anyone is interested, I'm documenting my finds here so everyone can find it later:
```
```
From Kohana.php in the system directory:

<-- snip if ($extension = self::find_file($type, self::$configuration['core']['extension_prefix'].$class))
{
// Load the extension
require $extension;
}
elseif ($suffix !== 'Core' AND class_exists($class.'_Core', FALSE))
{
// Class extension to be evaluated
$extension = 'class '.$class.' extends '.$class.'_Core { }';
-->

<-- snip

// Transparent class extensions are handled using eval. This is
// a disgusting hack, but it gets the job done.
eval($extension);

-->
```
```
So it does an eval..