-function path_to_convert() {
- if(!isset($GLOBALS['path_to_convert'])) {
- $GLOBALS['path_to_convert'] = _path_to_convert();
+# this function exists to deal with cases where binaries are installed in very
+# standard places (like /usr/bin or /usr/local bin) and PHP's PATH environment
+# variable is not set appropriately.
+function path_to($prog, $or_die = true) {
+ $prog = ereg_replace('[^a-zA-Z0-9_.-]', '', $prog);
+ $prog = ereg_replace('^[-.]*', '', $prog);
+ if($prog == '') {
+ die('Invalid argument to path_to()');