composer php - Is it safe to commit compiled.php file for Laravel? -
i understand laravel developers have ignored in .gitignore file, ignored composer.lock file think bad form. question safe commit , push compiled.php production?
it depends on deployment process , of include in compiled.php
file. if add composer.lock
in version manager, run composer install
when deploy , add nothing in config/compile.php
, yes quite safe.
but gain ? have put in composer.json
:
"scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "php artisan optimize" ] },
and compiled.php
file generated in each deployment. avoid kind of problem if in project decide run composer update
somewhere.
as package manager, composer managing dependencies. if commit compiled.php file, bypass composer , use compiled.php
rustic package manager...
Comments
Post a Comment