Recently, I’ve released an open-source class – wrapper of API functions available from one of the leading SMS gateway, which provides an HTTP-API access to send an SMS messages.
Now I want to make a custom command line utitity, which can be available for user anywhere in the command line, so he can send SMS just by running console command like this one:
$ my_custom_send_sms_command -u your_username -p your_password -k your_api_key 447771234567 'Hello from CLI'
Please, explain how this can be done?
Updated:
Class is written in PHP.
Make sure you have the PHP CLI package installed. On my Ubuntu VPS I had to run:
Check that it’s installed:
Then, create a file called something like
sendsms.phpwith contents similar to this:Make sure the file has execute permissions:
And then run it from the current folder like this: