(07-03-2015, 02:53 AM)Narf Wrote: Well, neither CI_Loader::library(), nor any method in its stack trace call the load_class() function. And also, line 192 in system/core/Common.php for CI3 is this:
Code:is_loaded($class);
... which couldn't possibly trigger the error message that you originally reported.
So, you most certainly have made modifications to the system/ directory, even if you didn't put your custom libraries in there. And that doesn't exclude the possibility of you having a MY_Loader override or one of your custom libs calling load_class() itself.
i put some echo in the common.php to check the error and what's happening there, so line number might change, as at my side line 192 points to
PHP Code:
$_classes[$class] = isset($param)
? new $name($param)
: new $name();
and the error is due to the
Code:
new $name()
Also if you might have noticed the following part in the above function that i pasted from Common.php CI_ is being added to all class names whether it's in system or application directory
Code:
$name = 'CI_'.$class;
PHP Code:
if (file_exists($path.$directory.'/'.$class.'.php'))
{
$name = 'CI_'.$class;
if (class_exists($name, FALSE) === FALSE)
{
require_once($path.$directory.'/'.$class.'.php');
}
break;
}
and that will make the variable $name to be having value "CI_libraryname" , so that at the initialization point it will always try to initiate the $name(), while that class doesn't exist, due to the addition of "CI_" in the class name