I have a php command line tool that I would like to share with the world. Well, actually I plan to write it, and it is a tool for loading design documents into couchdb, but that's not really the point.
Anyway, is there a best practice for packaging php scripts so that they can be distributed for easy installation? I'm thinking something along the lines of the good old "./configure & make & make install", but what to do for a php script? I have read about phar, but it seems that it is intended mainly for libraries. So any ideas? Or examples of how other projects have done this?
PHP is well known for its popularity with web applications and CMSs, but what many people don't know is that PHP is also a great language for building command line applications that don't require a web server.
PHP's Command Line Interface (CLI) allows you to execute PHP scripts when logged in to your server through SSH. ServerPilot installs multiple versions of PHP on your server so there are multiple PHP executables available to run.
Composer is a good example of how to package up the tool, both as a stand-alone set of source code, and code that can be run. I installed it as a phar and now can just run it anywhere as 'composer --options args
'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With