phake – make, in PHP. Nearly.


Today I pushed a relatively stable version of ‘phake’, a make-like environment written in PHP.

I’ve written this with a few things in mind: there are too many stand-alone PHP scripts in the world. Too many of those scripts don’t have easy to understand options. And, developers are lazy.

Grab it from: http://github.com/danfrost/phaker/tree/master
Once you’ve installed it, just type:
phake

You can see some examples using
phake dummy action1

Or
phake help dummy

If you want to create your own 'phake script', do:

phake help howto

When you’ve made it, you can run it by doing:
phake myscript

Howto: get command-line arguments

Getting CLI arguments in PHP is easy you just use $argv and then.. blar blar blar blar. Phake is better – in phake, you just create your function with arguments and phaker words out how to pass stuff from the CLI user to your method. E.g.

function mymethod($foo, $bar) {
echo "foo = $foo; bar = $bar";
}

Then, on the command-line do:

phake myscript mymethod --foo this-is-foo --bar this-is-bar


Leave a Reply