Laravel - Generating bootstrap/compiled.php without invoking the composer dump-autoload --optimize
autoload, composer-php, laravel, optimization, php
Solution
Looking at the code, it seems that there is no way to do that. But I changed the code to provide an option and made a pull request: https://github.com/laravel/framework/pull/3708.
EDIT
Pull request merged. Now you can run:
php artisan optimize --psr
Problem
The documented way to generate bootstrap/compiled.php is to run the artisan command: artisan optimize The problem with artisan optimize is that it runs composer dump-autoload --optimize which flattens out every PSR-0 loading class in composer_classmap.php file. If you are using a library like Zend with PSR-0 autoloading, this classmap file goes beyond 3000 lines. Which is very un-optimal to load on every web request, so I do not want to do that. How do I simply generate the compiled.php file without populating the composer classmap file?