$TINYBOARD_PATH environment varaible
This commit is contained in:
parent
64c1f6821c
commit
6a52a9b31e
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This script will look for Tinyboard in the following places (in order):
|
* This script will look for Tinyboard in the following places (in order):
|
||||||
|
* - $TINYBOARD_PATH environment varaible
|
||||||
* - ./
|
* - ./
|
||||||
* - ./Tinyboard/
|
* - ./Tinyboard/
|
||||||
* - ../
|
* - ../
|
||||||
@ -9,7 +10,9 @@
|
|||||||
|
|
||||||
$shell_path = getcwd();
|
$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;
|
$dir = false;
|
||||||
elseif(file_exists('Tinyboard') && is_dir('Tinyboard') && file_exists('Tinyboard/inc/functions.php'))
|
elseif(file_exists('Tinyboard') && is_dir('Tinyboard') && file_exists('Tinyboard/inc/functions.php'))
|
||||||
$dir = 'Tinyboard';
|
$dir = 'Tinyboard';
|
||||||
@ -21,8 +24,12 @@ else
|
|||||||
if($dir && !chdir($dir))
|
if($dir && !chdir($dir))
|
||||||
die('Could not change directory to ' . $dir . '!');
|
die('Could not change directory to ' . $dir . '!');
|
||||||
|
|
||||||
// follow symlink
|
if(!getenv('TINYBOARD_PATH')) {
|
||||||
chdir(realpath('inc') . '/..');
|
// follow symlink
|
||||||
|
chdir(realpath('inc') . '/..');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo 'Tinyboard: ' . getcwd() . "\n";
|
||||||
|
|
||||||
require 'inc/functions.php';
|
require 'inc/functions.php';
|
||||||
require 'inc/display.php';
|
require 'inc/display.php';
|
||||||
|
Loading…
Reference in New Issue
Block a user