--- On Sun, 8/23/09, Aryeh Gregor Simetrical+wikilist@gmail.com wrote:
If they can run commands on the command line, then they can use environment variables. If they can't, then your suggestion doesn't help.
If there are administrators who can execute command
lines, but cannot set environmental variables (e.g., they are confined to use a special shell)
There aren't. That would make no sense.
Thanks for clarifying the situation. Given this information I suggest changing all code in command line utilities of the form:
$IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { $IP = dirname(__FILE__).'/../..'; }
to:
$IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { echo "Error. The environmental variable MW_INSTALL_PATH must be set to the root of the MW distribution. Exiting.\n"; die(); }
This would eliminate file position dependent code from the command line utilities, making them easier to maintain (i.e., they can be moved in the distribution without breaking them).
Dan