Undefined method DB::select()

Hi, trying to update a Kohana 3.3 project to Koseven but have been running into a ‘Call to undefined method DB::select()’ error.

It’s the DB::Select in MODPATH/orm/classes/Kohana/ORM.php [ 1081 ]

I’ve also tried it on a fresh installation pulled from Github but still get the same issue when I try to call ORM::Factory(‘modelhere’, $id).

Any idea as to why this is happening?

I’m on PHP7 and the environment tests are all green except for the optional PECL.

Relevant stack:

  1. [MODPATH/orm/classes/Kohana/ORM.php [ 1126 ]]
  2. [MODPATH/orm/classes/Kohana/ORM.php [ 290 ]]
  3. [MODPATH/orm/classes/Kohana/ORM.php [ 46 ]]
  4. [APPPATH/classes/Controller/Staff.php [ 44 ]]

Hello @AKito and Welcome to the Koseven Forum,

there are some questions i have:

did you activate the database module in your bootstrap?
do you overwrite / extend the DB class somewhere inside your code?


Hi and thank you for the time.

Yes I have it activated. Currently I only have database and orm in the module list.

In the fresh install, I only have a single model, controller, and view and no other code. The model extends ORM.

It seems I may have messed up the autoloader or something. When the ORM refers to DB, it’s calling Pear’s DB class and not the Koseven one that extends Kohana_DB.

It will work if I modify the core files to use Kohana_DB::Select, but that’s not ideal. The Kohana project is a subsytem for another project that uses Pear DB and it’s probably referring to that. Do you have suggestion on where I should start to resolve this? Thanks.