diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-03-15 02:11:38 +1100 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-03-15 02:11:38 +1100 |
| commit | 6a52a9b31ecfbb0cc8fce59ded0a5662b2cce915 (patch) | |
| tree | 780fe26cb67d126039c8fe4e691f2a13c691d9fd /tools/inc | |
| parent | 64c1f6821c90297cf3d1c4b8a4bbec6fe4449016 (diff) | |
$TINYBOARD_PATH environment varaible
Diffstat (limited to 'tools/inc')
| -rw-r--r-- | tools/inc/cli.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/inc/cli.php b/tools/inc/cli.php index fbb3cfc5..fcf1c26a 100644 --- a/tools/inc/cli.php +++ b/tools/inc/cli.php @@ -2,6 +2,7 @@ /* * This script will look for Tinyboard in the following places (in order): + * - $TINYBOARD_PATH environment varaible * - ./ * - ./Tinyboard/ * - ../ @@ -9,7 +10,9 @@ $shell_path = getcwd(); -if(file_exists('inc/functions.php')) +if(getenv('TINYBOARD_PATH') !== false) + $dir = getenv('TINYBOARD_PATH'); +elseif(file_exists('inc/functions.php')) $dir = false; elseif(file_exists('Tinyboard') && is_dir('Tinyboard') && file_exists('Tinyboard/inc/functions.php')) $dir = 'Tinyboard'; @@ -21,8 +24,12 @@ else if($dir && !chdir($dir)) die('Could not change directory to ' . $dir . '!'); -// follow symlink -chdir(realpath('inc') . '/..'); +if(!getenv('TINYBOARD_PATH')) { + // follow symlink + chdir(realpath('inc') . '/..'); +} + +echo 'Tinyboard: ' . getcwd() . "\n"; require 'inc/functions.php'; require 'inc/display.php'; |
