enygma/usher — pull request #8 by robertbasic (2011-12-28 18:49:54+00:00)
Title: shell script for usher

Hi!

I've played around in the shell a bit and tried to create something for #6 (even though my branch says feature/7... sorry about that :))

Anyway... The script tries to locate the PHP binary by using the "which" command. Hopefully there are not many distros without that command out there. Any error "which" might produce, is discarded.

The first check is there for cases when the which command returns nothing/null (that's why the $PHP_BINPATH is quoted in double quotes).

The second check is there to see if $PHP_BINPATH is a file and is an executable.

If everything seems OK, usher.php is called. The "$@" part is there to pass any command line arguments down to usher.php, so things like ./usher --quiet still works.

Tested on Fedora and Ubuntu, will test on a FreeBSD over the weekend.

I know it's far from perfect, but it's a start :)