title: CodeIgniter 2: not loading MY_Loader class
body: <p>I have been trying to override the "database" method of the loader class (CI_Loader). I followed the instructions found on the CodeIgniter user guide: <a href="http://codeigniter.com/user_guide/general/creating_libraries.html" rel="nofollow" title="CodeIgniter User Guide: Creating Libraries">Creating Libraries</a> (scroll to "Extending Native Libraries"). But MY_Loader class does not load automatically and is not used in <code>$this-&gt;load</code> calls in place of the CI core Loader class.
  I've only created MY_Loader class (application/libraries/MY_Loader.php as specified in the user guide). Is there something I'm missing?
  I've tried to put it in config/autoload.php for the libraries section of that file, and it indeed is autoloaded, but then I access to the library using <code>$this-&gt;my_loader-&gt;database()</code> and that's not the idea...</p>
  
  <p>I paste below the content of application/libraries/MY_Loader.php</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class MY_Loader extends CI_Loader {
  
      function database($params = '', $return = FALSE, $active_record = NULL)
      {
          echo '---test---';
          exit;
      }
  }
  </code></pre>
  
  <p>Thank you very much.</p>