Create a composer dir called pgit
Create a composer.json file inside this dir containing:
{
"require": {
"diversen/minimal-cli-framework": "^1.1"
},
"bin": [
"pgit"
]
}
Create a pgit
file inside the pgit
dir, which should contain:
#!/usr/bin/env php
<?php
echo "hello world\n";
Build this using phar-composer (outside pgit dir)
phar-composer.phar build pgit
You now have an executable called
pgit.phar
Execute it:
./pgit.phar
It should say: hello world