CodeIgniter Forums
extending core class not function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: extending core class not function (/thread-50677.html)



extending core class not function - El Forum - 04-04-2012

[eluser]mardon[/eluser]
Hi I would error log messages send by email. T extend core class in application/core i have MY_Exceptions.php with this code
Code:
<?php
class MY_Exceptions extends CI_Exceptions {

    function __construct(){
   parent::__construct();
}

    function log_exception($severity, $message, $filepath, $line)

    {  

        $ci =& get_instance();
        $severity = ( ! isset($ci->levels[$severity])) ? $severity : $ci->levels[$severity];

        log_message('error', 'Severity: '.$severity.'  --> '.$message. ' '.$filepath.' '.$line, TRUE);

        $ci->load->library('email');
        $ci->email->from('[email protected]', 'Server Name');
        $ci->email->to('[email protected]');


        $ci->email->subject('error');
        $ci->email->message('Severity: '.$severity.'  --> '.$message. ' '.$filepath.' '.$line);

        $ci->email->send();
    }

}

where i have mistake, this code isnt function