[Solved] Codeigniter: Load Library in a Core Class |
I did find one way to incorporate the CI email class. It uses the same basic approach you have used in loading PHPMailer. This even loads and uses application/config/email.php . (It is assumed to be there which is dangerous but this is just a proof-of-concept.)
Code: class MY_Log extends CI_Log For this to work there is one small hack that MUST BE MADE to system/libraries/Email.php The last line in the constructor must be removed (or commented out) Code: //log_message('info', 'Email Class Initialized'); Otherwise a loop condition exists where that call (log_message) tries to load the Log class, which tries to instantiate the Email class and... around and around we go. So, there's your CI email class. Hope you don't want to load any other core libraries. |
Welcome Guest, Not a member yet? Register Sign In |