diff options
Diffstat (limited to 'public_html/vfs_bootstrap.php')
| -rw-r--r-- | public_html/vfs_bootstrap.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/public_html/vfs_bootstrap.php b/public_html/vfs_bootstrap.php index 4f0e05d..13dab22 100644 --- a/public_html/vfs_bootstrap.php +++ b/public_html/vfs_bootstrap.php @@ -3,9 +3,46 @@ require_once( dirname(__FILE__) . '/vfs_config.php'); +# absolute path +if ( ! defined(ABSPATH) ) + define('ABSPATH', dirname(__FILE__) . '/'); + +# file directory +if ( ! defined(FILEPATH) ) + define('FILEPATH', ABSPATH . '../files'); + +# scheme, set to https if set, otherwise plain http +if ( ! defined(SCHEME) ){ + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + define('SCHEME', 'https://'); + else + define('SCHEME', 'http://'); +} + +# hostname +if ( ! defined(HOST) ) + define('HOST', $_SERVER['HTTP_HOST']); +if ( ! defined(DOMAIN) ) + define('DOMAIN', SCHEME . HOST); + if ( ! defined(VFS_CLASS) ) define('VFS_CLASS', 'class/'); +# redis access +# if ( ! defined(USE_REDIS) ) +# define('USE_REDIS', false); +# if ( ! defined(REDIS_CONNECT) ) +# define('REDIS_CONNECT', '/var/run/redis/redis.sock'); +# if ( ! defined(REDIS_DBNAME) ) +# define('REDIS_DBNAME', 1); + +# redirects to correct host +if ( $_SERVER['HTTP_HOST'] != HOST){ + header($_SERVER['SERVER_PROTOCOL']. ' 301 Moved Permanently'); + header('Location: ' . DOMAIN); + exit; +} + require(ABSPATH . 'functions.php'); require(ABSPATH . VFS_CLASS . 'mysql.php'); |
