For creating PHP packages several best practices has been established, like composer support (ofc) and putting the package on packagist, travis integration, directory organisation, tests, documentation and so on.
For further information i recommend these slides https://laravel-news.com/2015/08/hannes-van-de-vreken-package-development-slides/ which describe the situation very well.
And as we are all lazy, we like generators that scaffold a basic php package layout and luckily there are several out there.
They all differ a bit, so pick your favorite.
Continue reading “PHP package generators”
Using your forks of certain packages with composer is actually pretty easy:
Add the repo of the fork to the repositories block of your composer.json, you might need to change the version to f.e dev-master and thats it. Great. Actually.
But there are some traps, especially when you are mentally already weekend bound:
When working in a team, take care that you dont add your fork as a private repo.
This happens when you use the @ notation like ‘email@example.com‘. Its tempting because it will be the clone url on github when you are logged in, which is very likely.
If you do so your team mates will get errors like this:
Failed to execute git clone --no-checkout 'firstname.lastname@example.org:ivoba/SomeBundle.git' [...] && git remote add composer 'email@example.com:ivoba/SomeBundle.git' && git fetch composer
Continue reading “Using forks with composer – late night edition”
I usually would not recommend deployment via git and running composer on your prod server for several reasons like f.e. the network. I rather believe in builds.
But sometimes its just too convenient :)
So i have this uncritical smaller API app where the hosting has git, ssh access and i am in full control and i decided too keep it simple.
Continue reading “git deploy with composer install hook”