forked from A1mDev/hlstatsx-community-edition
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from startersclan/enhancement/web-add-env-var-…
…config-support-for-web-config Enhancement (web): Add env var config support for `web` config
- Loading branch information
Showing
5 changed files
with
49 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Copyleft (L) 2008-20XX Nicholas Hastings ([email protected]) | ||
http://www.hlxcommunity.com | ||
HLstatsX Community Edition is a continuation of | ||
HLstatsX Community Edition is a continuation of | ||
ELstatsNEO - Real-time player and clan rankings and statistics | ||
Copyleft (L) 2008-20XX Malte Bayer ([email protected]) | ||
http://ovrsized.neo-soft.org/ | ||
|
@@ -18,7 +18,7 @@ | |
HLstats - Real-time player and clan rankings and statistics for Half-Life | ||
http://sourceforge.net/projects/hlstats/ | ||
Copyright (C) 2001 Simon Garner | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
|
@@ -36,54 +36,61 @@ | |
For support and installation notes visit http://www.hlxcommunity.com | ||
*/ | ||
|
||
if (!defined('IN_HLSTATS')) { | ||
die('Do not access this file directly.'); | ||
if (!defined("IN_HLSTATS")) { | ||
die("Do not access this file directly."); | ||
} | ||
|
||
function defineVar($name, $default) { | ||
$value = getenv($name) ? getenv($name) : $default; | ||
$value = gettype($default) == 'boolean' && $value == 'false' ? false : $value; // Fix string 'false' becoming true for boolean when using settype | ||
settype($value, gettype($default)); | ||
define($name, $value); | ||
} | ||
|
||
// DB_ADDR - The address of the database server, in host:port format. | ||
// (You might also try setting this to e.g. ":/tmp/mysql.sock" to | ||
// use a Unix domain socket, if your mysqld is on the same box as | ||
// your web server.) | ||
define("DB_ADDR", 'localhost'); | ||
defineVar("DB_ADDR", 'localhost'); | ||
|
||
// DB_USER - The username to connect to the database as | ||
define("DB_USER", ''); | ||
defineVar("DB_USER", ''); | ||
|
||
// DB_PASS - The password for DB_USER | ||
define("DB_PASS", ''); | ||
defineVar("DB_PASS", ''); | ||
|
||
// DB_NAME - The name of the database | ||
define("DB_NAME", ''); | ||
defineVar("DB_NAME", ''); | ||
|
||
// DB_TYPE - The database server type. Only "mysql" is supported currently | ||
define("DB_TYPE", 'mysql'); | ||
defineVar("DB_TYPE", 'mysql'); | ||
|
||
// default 'utf8mb4' | ||
define("DB_CHARSET", 'utf8mb4'); | ||
defineVar("DB_CHARSET", 'utf8mb4'); | ||
|
||
// default 'utf8mb4_unicode_ci' | ||
define("DB_COLLATE", 'utf8mb4_unicode_ci'); | ||
defineVar("DB_COLLATE", 'utf8mb4_unicode_ci'); | ||
|
||
// DB_PCONNECT - Set to 1 to use persistent database connections. Persistent | ||
// connections can give better performance, but may overload | ||
// the database server. Set to 0 to use non-persistent | ||
// connections. | ||
define("DB_PCONNECT", 0); | ||
defineVar("DB_PCONNECT", 0); | ||
|
||
// INCLUDE_PATH - Filesystem path to the includes directory, relative to hlstats.php. This must be specified | ||
// as a relative path. | ||
// | ||
// Under Windows, make sure you use forward slash (/) instead | ||
// of back slash (\) and use absolute paths if you are having any issue. | ||
define("INCLUDE_PATH", './includes'); | ||
defineVar("INCLUDE_PATH", './includes'); | ||
|
||
|
||
// PAGE_PATH - Filesystem path to the pages directory, relative to hlstats.php. This must be specified | ||
// as a relative path. | ||
// | ||
// Under Windows, make sure you use forward slash (/) instead | ||
// of back slash (\) and use absolute paths if you are having any issue. | ||
define("PAGE_PATH", './pages'); | ||
defineVar("PAGE_PATH", './pages'); | ||
|
||
|
||
// PAGE_PATH - Filesystem path to the hlstatsimg directory, relative to hlstats.php. This must be specified | ||
|
@@ -93,13 +100,13 @@ | |
// of back slash (\) and use absolute paths if you are having any issue. | ||
// | ||
// Note: the progress directory under hlstatsimg must be writable!! | ||
define("IMAGE_PATH", './hlstatsimg'); | ||
defineVar("IMAGE_PATH", './hlstatsimg'); | ||
|
||
// How often dynamicly generated images are updated (in seconds) | ||
define("IMAGE_UPDATE_INTERVAL", 300); | ||
defineVar("IMAGE_UPDATE_INTERVAL", 300); | ||
|
||
define('GOOGLE_MAPS_API_KEY', ""); | ||
defineVar('GOOGLE_MAPS_API_KEY', ""); | ||
|
||
//define("DB_DEBUG", true); | ||
defineVar("DB_DEBUG", false); | ||
|
||
?> |