Scripts

Phork is set up to allow PHP command line scripts to be run. The scripts are all routed through phork/sites/[sitetype]/scripts/index.php front controller which is set up very similar to the sites' index.php files. Because scripts can't rely on server variables, the config type (dev, live, etc) can't be determined from the host name so it needs to be explicitly passed to the script at run time.

Running Scripts

Scripts should be passed arguments similar to the URL segments. The first argument is the server type, the second argument is the name of the controller, the third argument is the display method in that controller, and the rest of the arguments are available in the CoreUrl object. Scripts are routed just the same as the sites are.

In this example the processing would be dispatched to MyScriptController::run() which would load the live configuration files and would call displayFoo().

/usr/bin/php /path/to/phork/sites/public/scripts/index.php live MyScript foo bar