A single PHP file is the perfect solution to this. Call it from /etc/crontab and you are done.
I hate overladen projects on GitHub with all kinds of fluff. A single source file and a readme is just awesome.
A single PHP file is the perfect solution to this. Call it from /etc/crontab and you are done.
I hate overladen projects on GitHub with all kinds of fluff. A single source file and a readme is just awesome.
Since you have to write a new PHP file anyway, composer allows you to pull in the latest version (or update it) with semver constraints.
Then you can package it as a phar and call it that way.
This is a library, not a file to run, and so it should have composer support.
Or, if you don't want to package it as a PHAR - since I have no idea how to do that, you'd implement your version in some directory and probably alias a command to it.
TL;DR: This is a library, not a script. It should have composer support.
You don't have to. Composer allows you to pick a particular package version if you like, and it's only going to fetch a more recent version if your composer.json permits it and if you explicitly run composer update.
On the other hand, what if you have a slightly more complex system with some logic to handle crons?