Composer breaks exisiting autoload in Codeigniter |
[eluser]coderego[/eluser]
I was using Codeigniter to do autoloading for some core classes using the method described here: Code: http://philsturgeon.co.uk/blog/2010/02/CodeIgniter-Base-Classes-Keeping-it-DRY Thanks!
[eluser]Aken[/eluser]
Replace your __autoload() function with an spl_autoload_register().
[eluser]Adrian Walls[/eluser]
I had the very same issue the other day. Remove the lines relating to autoload above and add the following to your composer.json file: Code: "autoload": { Also, don't forget to add the composer autoload file to your CI bootstrap file.
[eluser]coderego[/eluser]
Adrian Walls, That should work....but it doesn't. is there any pathing considerations maybe? composer.json is in the project root. application is a folder in the root. { "autoload": { "classmap": ["application/core"] }, "require": { "php": ">=5.3.0", "illuminate/database": "*" } }
[eluser]coderego[/eluser]
Adrian Walls, That should work....but it doesn't. is there any pathing considerations maybe? composer.json is in the project root. application is a folder in the root. Code: {
[eluser]Adrian Walls[/eluser]
There shouldn't be. My composer.json file is at the web root level and so is the CI application folder. What exactly is happening when you do this? How are you including the composer autoload.php file? I've added the following to index.php: Code: /* just before: Code: /* |
Welcome Guest, Not a member yet? Register Sign In |