|
2 | 2 | /** |
3 | 3 | * Database Information |
4 | 4 | */ |
5 | | -define("HV_DB_HOST", "localhost"); |
6 | | -define("HV_DB_NAME", "helioviewer"); |
7 | | -define("HV_DB_USER", "helioviewer"); |
8 | | -define("HV_DB_PASS", "helioviewer"); |
| 5 | +define("HV_DB_HOST", $_ENV['HV_DB_HOST'] ?? "localhost"); |
| 6 | +define("HV_DB_NAME", $_ENV['HV_DB_NAME'] ?? "helioviewer"); |
| 7 | +define("HV_DB_USER", $_ENV['HV_DB_USER'] ?? "helioviewer"); |
| 8 | +define("HV_DB_PASS", $_ENV['HV_DB_PASS'] ?? "helioviewer"); |
9 | 9 |
|
10 | 10 | /** |
11 | 11 | * Redis Database Information |
12 | 12 | * Used for rate-limiting |
13 | 13 | */ |
14 | | -define("HV_REDIS_HOST","127.0.0.1"); |
15 | | -define("HV_REDIS_PORT",6379); |
| 14 | +define("HV_REDIS_HOST", $_ENV['HV_REDIS_HOST'] ?? "127.0.0.1"); |
| 15 | +define("HV_REDIS_PORT", $_ENV['HV_REDIS_PORT'] ?? 6379); |
16 | 16 |
|
17 | 17 | /** |
18 | 18 | * In order to enable users to submit videos to YouTube, you must register for |
19 | 19 | * a developer key which is included with each request. For more information |
20 | 20 | * and to request a key, see: |
21 | 21 | * http://code.google.com/apis/youtube/overview.html |
22 | 22 | */ |
23 | | -define("HV_YOUTUBE_DEVELOPER_KEY", ""); |
24 | | -define("HV_GOOGLE_OAUTH2_CLIENT_ID", ""); |
25 | | -define("HV_GOOGLE_OAUTH2_CLIENT_SECRET", ""); |
| 23 | +define("HV_YOUTUBE_DEVELOPER_KEY", $_ENV['HV_YOUTUBE_DEVELOPER_KEY'] ?? ""); |
| 24 | +define("HV_GOOGLE_OAUTH2_CLIENT_ID", $_ENV['HV_GOOGLE_OAUTH2_CLIENT_ID'] ?? ""); |
| 25 | +define("HV_GOOGLE_OAUTH2_CLIENT_SECRET", $_ENV['HV_GOOGLE_OAUTH2_CLIENT_SECRET'] ?? ""); |
26 | 26 |
|
27 | 27 | /** |
28 | 28 | * Password to use when generating unique movie IDs. This can be any random |
29 | 29 | * string, e.g. "8sHNa4ju". It is used during hashing to create public |
30 | 30 | * video id's that can be used for sharing. |
31 | 31 | */ |
32 | | -define("HV_MOVIE_ID_PASS", ""); |
| 32 | +define("HV_MOVIE_ID_PASS", $_ENV['HV_MOVIE_ID_PASS'] ?? ""); |
33 | 33 |
|
34 | 34 | /** |
35 | 35 | * bit.ly API user and key |
|
38 | 38 | * Twitter etc. For more information and to register for a free API key, see: |
39 | 39 | * http://code.google.com/p/bitly-api/wiki/ApiDocumentation |
40 | 40 | */ |
41 | | -define("HV_BITLY_USER", ""); |
42 | | -define("HV_BITLY_ALLOWED_DOMAIN", ""); // string to validate correct domain name when using AJAX |
43 | | -define("HV_BITLY_API_KEY", ""); |
44 | | -define("HV_SHORTENER_REDIS_DB", 10); |
| 41 | +define("HV_BITLY_USER", $_ENV['HV_BITLY_USER'] ?? ""); |
| 42 | +define("HV_BITLY_ALLOWED_DOMAIN", $_ENV['HV_BITLY_ALLOWED_DOMAIN'] ?? ""); // string to validate correct domain name when using AJAX |
| 43 | +define("HV_BITLY_API_KEY", $_ENV['HV_BITLY_API_KEY'] ?? ""); |
| 44 | +define("HV_SHORTENER_REDIS_DB", $_ENV['HV_SHORTENER_REDIS_DB'] ?? 10); |
45 | 45 |
|
46 | 46 | /** |
47 | 47 | * Proxy Settings |
48 | 48 | */ |
49 | | -define("HV_PROXY_HOST", ""); |
50 | | -define("HV_PROXY_USER_PASSWORD", ""); // must be a string in username:password format, leave it empty if proxy do not use authorization |
| 49 | +define("HV_PROXY_HOST", $_ENV['HV_PROXY_HOST'] ?? ""); |
| 50 | +define("HV_PROXY_USER_PASSWORD", $_ENV['HV_PROXY_USER_PASSWORD'] ?? ""); // must be a string in username:password format, leave it empty if proxy do not use authorization |
51 | 51 |
|
52 | 52 | /** |
53 | 53 | * Terminal commands that need to be checked for running |
|
59 | 59 | * TODO: |
60 | 60 | * PHP 7 support arrays inside constants. |
61 | 61 | */ |
62 | | -define("TERMINAL_COMMANDS", serialize(array())); |
| 62 | +define("TERMINAL_COMMANDS", $_ENV['TERMINAL_COMMANDS'] ?? serialize(array())); |
63 | 63 | ?> |
0 commit comments