Reputation: 1065
I am using composer. Composer autoload file is in the application/vendor/autoload.php. In codeigniter 3 I set ["composer_autoload"] = true in config. But it is overriding the main autoload of the codeigniter and couldn't able to load the Main classes of codeigniter and my codeigniter libraries. What should i do?
Upvotes: 1
Views: 573
Reputation: 1065
At the end of the config file there is comment like below just uncomment it.
spl_autoload_register( function ( $class ) {
$file = "sources/" . $class . ".class.php";
if ( file_exists( $file ) ) {
require $file;
return;
}
} );
Make $config['composer_autoload'] = FALSE;
Then add ( require FCPATH . 'application/vendor/autoload.php'; ) below the spl_autoload_resgister function.
Upvotes: 1