• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in extending CI_Loader: Class 'CI_Loader' not found

#1
I'm trying to extend CI_Loader class to override _ci_load_library(), but I'm receiving a Fatal Error:
    
Code:
Fatal error: Class 'CI_Loader' not found in C:\Users\X\workspace\ci-app\application\core\MY_Loader.php on line 4
A PHP Error was encountered
Severity: Error

Message: Class 'CI_Loader' not found

Filename: core/MY_Loader.php

Line Number: 4

Backtrace:

The class MY_Loader is located in application/core/MY_Loader.php, and it's like this:
    
PHP Code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');


class 
MY_Loader extends CI_Loader
{
    public function __construct()
    {
        parent::__construct();
    }

    protected function _ci_load_library($class$params NULL$object_name NULL)
    {
        // ...
    }


I just did a fresh installation of CodeIgniter, so I'm using the latest version: 3.1.9
And I'm also using PHP built-in server: php -S localhost:8000 index.php
Reply

#2
It must not be finding the paths, because I just tried your code here and it works fine

What OS and are you using XAMPP or what?

Did you setup your config base url etc; ?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(09-05-2018, 03:26 AM)InsiteFX Wrote: It must not be finding the paths, because I just tried your code here and it works fine

What OS and are you using XAMPP or what?

Did you setup your config base url etc; ?

I'm using Windows 10 Home Edition.
I'm not using XAMPP, I'm using PHP built-in server: php -S localhost:8000 index.php

And yes, I setup my base_url at config.php:
PHP Code:
$config['base_url'] = 'http://localhost:8000/'
Reply

#4
I'm running Windows 10 Pro with XAMPP and php 7.2.9

Using VHOSTS and phpStorm where I specify a root folder for the application.

You may need to setup your php editor for the correct location of the application.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
I'm having the same problem with the latest CI version. Something has changed and I haven't found a solution.
Reply

#6
It has something to do with your installation and setup.

Like I mentioned above it works fine on my system that I posted above.

It's not a CodeIgniter issue.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.