Hey everbody!
I want to extend the /system/core/Log.php library with a couple of functions. One function should send a mail in case of an error via the custom function sendMail() which is part of the Custom_library.php.
Thus, I created the file /application/core/MY_Log.php
The problem: I'm not able to load the Custom_library.php. None of these approaches worked:
The question: Is it possible to load and utilize a Library in a Core Class?
Merci!
I want to extend the /system/core/Log.php library with a couple of functions. One function should send a mail in case of an error via the custom function sendMail() which is part of the Custom_library.php.
Thus, I created the file /application/core/MY_Log.php
PHP Code:
class MY_Log extends CI_Log {
public function __construct()
{
parent::__construct();
}
public function write_log($level, $msg)
{
$result = parent::write_log($level, $msg);
return $result;
}
}
The problem: I'm not able to load the Custom_library.php. None of these approaches worked:
PHP Code:
//aproach 1
$this->load->library('Custom_library');
//aproach 2
$CI =& get_instance();
$CI->load->library('Custom_library');
The question: Is it possible to load and utilize a Library in a Core Class?
Merci!