I don't understand the debate. Maybe it is case of the framework getting in the way of thinking clearly
However, using the following code, I'm extending, overloading and whatever else like crazy. No include_once's anywhere, just a simple autoloader I added to config/config.php
Code:
/*
|--------------------------------------------------------------------------
| Auto-load models, controllers, libraries and more oh my
|--------------------------------------------------------------------------
*/
function application_autoloader($class) {
$locations = array(
APPPATH.'models'.DIRECTORY_SEPARATOR.strtolower($class).'.php',
APPPATH.'controllers'.DIRECTORY_SEPARATOR.ucfirst(strtolower($class)).'.php',
APPPATH.'libraries'.DIRECTORY_SEPARATOR.ucfirst(strtolower($class)).'.php',
APPPATH.'core'.DIRECTORY_SEPARATOR.strtolower($class).'.php',
);
foreach($locations as $location) :
if(file_exists($location)) :
include $location;
endif;
endforeach;
}
spl_autoload_register('application_autoloader');
function system_autoloader($class) {
$class = ucfirst(str_replace('CI_', '', $class)).'.php';
$locations = array(
BASEPATH.'libraries'.DIRECTORY_SEPARATOR.$class,
BASEPATH.'core'.DIRECTORY_SEPARATOR.$class,
);
foreach($locations as $location) :
if(file_exists($location)) :
include $location;
endif;
endforeach;
}
spl_autoload_register('system_autoloader');