php - Running composer locally vs from VM -


i wondering pros , cons regarding different ways in can run composer tool.

i used running composer directly vagrant vm, great because don't need install php , composer locally. benefit see in approach don't have worry different php versions between local machine , vm. that's important because packages can define requirement on php version, have acceptable version inside vm, older version on machine, stop me installing package.

the benefit in having composer installed locally, can find, when don't use separate development environment , want fast access composer. main reason why asking question, because noticed people regularly using local composer installation in combination vagrant machine, don't find acceptable reasons mentioned above. so, thoughts on ?

i prefer docker on vm , i've prepared lightweight docker image containing php7-cli , few extensions, additionally phpunit, , composer , use automation of building php based projects.

here chunk of script pull code repo , starts preparing environment. user , project "variables".

#!/bin/bash cd /home/user/workspace/project  git fetch && git checkout develop git pull origin develop  rm -f junit.xml rm -f /home/user/workspace/project/unit_tests  sudo docker run -ti -a stderr --rm -v /home/user/workspace/project:/app kmwrona/ci-stack /usr/bin/composer install --quiet sudo docker run -ti -a stdout -v /home/user/workspace/porject:/app kmwrona/ci-stack /usr/bin/composer dump-autoload --optimize sudo chown -r user.user /home/user/workspace/project/vendor 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -