[eluser]bretticus[/eluser]
Pass those values to the class instead of calling them in the constructor. However in the example you have shown you are using a CI model. Not sure how you'd ever plan on using that class without using the CI framework.
Code:
class TEST_Log{
var $_ci;
function TEST_Log(){
$this->_ci =& get_instance();
$this->_ci->load->model("Log_model");
}
function Log($message = '', $message_type = 'Error' ){
$this->_ci->Log_model->insertLog($message_type , $message);
}
}
In other words, if you want the class to be instantiate-able outside of the framework, you cannot use framework objects within the class. I suggest if you need to use database functionality in your uncoupled classes that you instantiate a database connection within that class instead. Otherwise, you can pass variables to classes in CI via the second parameter (see the manual.) And as for any outside-framework code, call it in the usual way (new Object(param,...) )