I've a Kohana 3.3 project working in a linux server and I moved it to Amazon EC2 linux instance.
It loads correctly all 'classes/Model/xxxxx.php' Models, but fails if model has no file definition (models that only resides in database), showing a 'Model not found' error.
Also I've some problems with model's properties, showing a 'The aaaaaa property does not exist in the Model_Bbbbbb class'
I am aware of PSR-0 implementation on Kohana >3.2
Model not found error:
ErrorException [ Fatal Error ]: Class 'Model_role' not found
Property error:
Kohana_Exception [ 0 ]: The team property does not exist in the Model_User class
These are my implementations:
/application/classes/Model/user.php
class Model_User extends Model_Auth_User
{
public function rules()
{
…
}
protected $_has_many = array(
'team' => array('through' => 'user_teams'),
);
}
Database tables:
- roles
- users
- user_teams
Since this code is working on a previous linux server, I discarded PSR-0 problems, and I think this is a misconfiguration of Amazon Linux AMI.
Any idea?
You need to have a PHP class for each model. It's possible it can be very simple, such as
class Model_Role extends ORM {}
, but it needs to exist and be placed in the right directory for autoloading.probably you need to update the
$_table_columns
property in yourModel_User
to include theteam
field. The other possibility is your database doesn't have theteam
column in theusers
table.