The best thing is to explicitly write them to the new configuration file.
$config['controllers'] = array(
'blog',
'events',
'news',
);
Otherwise, you will scan directories that will consume resources. But you can do it like this:
$controllers = array();
$this->load->helper('file');
$files = get_dir_file_info(APPPATH.'controllers', FALSE);
foreach (array_keys($files) as $file)
{
$controllers[] = str_replace(EXT, '', $file);
}
print_r($controllers);
Since the file names match the names of the controllers, you should now have an array of all your controllers. This is not ideal, although for several reasons, but should work for most settings.
, , , . - , .
, , , .