I have a problem using Kohana 3.1. I add the old banks kohana-email module but the result is a error like this:
ErrorException [ Fatal Error ]: Class 'Email' not found
My application bootstrap.php file is like this:
Kohana::modules(array(
'user' => MODPATH.'user', // Useradmin module
'auth' => MODPATH.'auth', // Basic authentication
// 'cache' => MODPATH.'cache', // Caching with multiple backends
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
'database' => MODPATH.'database', // Database access
// 'image' => MODPATH.'image', // Image manipulation
'orm' => MODPATH.'orm', // Object Relationship Mapping
'kohana-email' => MODPATH.'kohana-email', // Kohana email module
//'email' => MODPATH.'email', // Email module
//'mailer' => MODPATH.'mailer', // Mailer module
'pagination' => MODPATH.'pagination', // Pagination module
'testmod' => MODPATH.'testmod',
// 'unittest' => MODPATH.'unittest', // Unit testing
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
));
As you can see, I tried with another email modules (mailer module and shadowhand's email module) with the same result.
Thinking about the error message, I create a module (named testmod) only with a init.php file like this:
<?php
die('It works');
?>
then, adding the testmod module in bootstrap, I get the "It works".
So, if the another modules (like orm, auth, user) works right, why kohana-email, emailer and mailer don't work?
EDIT: I must to extend my explanation:
The kohana-email module is in MODPATH.'kohana-email'
, because doing a echo MODPATH;
I can see the correct modules place.
My modules file-tree is like this:
modules (as echo MODPATH says)
|
+-- user (files from user module, this module works right)
|
+-- auth (files from auth module, this module works right)
|
+-- testmod (init.php file from testmod, this module works right)
|
+-- kohana-email
! |
: +-- classes
: | |
: | +-- email.php <--- The Email class is here!
: |
: +-- config
: | |
: | +-- email.php
: |
: +-- vendor
· |
· +-- swift
!
: (files from swift)
·
Yes, I probe it with Email::connect();
in the same bootstrap.php, after the Kohana::modules
line, and is here where throws the ErrorException. And, yes, I probe it with the shadowhand email module, but I get the same Error.
So, I re-ask the question:
Why kohana-email (and email, and mailer) module does not work? Or, why kohana can't locate the Email class?