Welcome Guest, Not a member yet? Register   Sign In
Custom config in extended class (library)
#1

[eluser]JackU[/eluser]
I´m extended the Log class to email me and some other guys when an error occurs. But i can´t get my config to load. It´s located in the config directory and a subdir. Also i´m changing the threshold levels (in the construct). Why can´t i get my config?

('application/config/extra/appconf.php)

Code:
class MY_Log extends CI_Log {
function MY_Log()
    {
        parent::__construct();
        $this->_levels = array('ERROR' => '1', 'INFO' => '2',  'DEBUG' => '3', 'ALL' => '4');
    }

function write_log($level = 'error', $msg, $php_error = FALSE)
    {
        $result = parent::write_log($level, $msg, $php_error);
        
        //Get my config with emails.
        $this->ci =& get_instance();
        $this->ci->load->config('extra/appconf');
        echo $this->ci->config->item('sendto_emails');
    }
}


Messages In This Thread
Custom config in extended class (library) - by El Forum - 02-28-2013, 03:20 AM
Custom config in extended class (library) - by El Forum - 02-28-2013, 09:57 AM
Custom config in extended class (library) - by El Forum - 02-28-2013, 10:02 AM
Custom config in extended class (library) - by El Forum - 02-28-2013, 10:23 AM
Custom config in extended class (library) - by El Forum - 02-28-2013, 02:40 PM
Custom config in extended class (library) - by El Forum - 03-01-2013, 02:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB