2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2023-01-10 22:44:09 +00:00
|
|
|
|
|
|
|
namespace Shimmie2;
|
|
|
|
|
2012-02-12 19:56:21 +00:00
|
|
|
/**
|
2020-01-27 19:28:58 +00:00
|
|
|
* For any values that aren't defined in data/config/*.php,
|
|
|
|
* Shimmie will set the values to their defaults
|
2012-02-12 19:56:21 +00:00
|
|
|
*
|
2020-01-27 19:28:58 +00:00
|
|
|
* All of these can be over-ridden by placing a 'define' in
|
2024-01-17 20:19:13 +00:00
|
|
|
* data/config/shimmie.conf.php, or by setting an environment
|
|
|
|
* variable SHM_{$name} (eg SHM_DATABASE_DSN)
|
2012-02-12 19:56:21 +00:00
|
|
|
*
|
|
|
|
* Do NOT change them in this file. These are the defaults only!
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* define("SPEED_HAX", true);
|
|
|
|
*/
|
2015-09-12 10:43:28 +00:00
|
|
|
|
2024-01-15 15:08:22 +00:00
|
|
|
function _d(string $name, mixed $value): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
if (!defined($name)) {
|
2024-01-17 20:19:13 +00:00
|
|
|
$env = getenv("SHM_{$name}");
|
|
|
|
if ($env !== false) {
|
2024-01-17 20:26:14 +00:00
|
|
|
$value = json_decode($env) ?? $env;
|
2024-01-17 20:19:13 +00:00
|
|
|
}
|
2019-05-28 16:59:38 +00:00
|
|
|
define($name, $value);
|
|
|
|
}
|
|
|
|
}
|
2024-01-06 19:32:33 +00:00
|
|
|
|
2020-10-25 21:25:38 +00:00
|
|
|
_d("DATABASE_DSN", null); // string PDO database connection details
|
|
|
|
_d("DATABASE_TIMEOUT", 10000); // int Time to wait for each statement to complete
|
|
|
|
_d("CACHE_DSN", null); // string cache connection details
|
|
|
|
_d("DEBUG", false); // boolean print various debugging details
|
|
|
|
_d("COOKIE_PREFIX", 'shm'); // string if you run multiple galleries with non-shared logins, give them different prefixes
|
|
|
|
_d("SPEED_HAX", false); // boolean do some questionable things in the name of performance
|
|
|
|
_d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse
|
2024-01-06 19:32:33 +00:00
|
|
|
_d("VERSION", "2.10.0-beta2"); // string shimmie version
|
2020-10-25 21:25:38 +00:00
|
|
|
_d("TIMEZONE", null); // string timezone
|
|
|
|
_d("EXTRA_EXTS", ""); // string optional extra extensions
|
|
|
|
_d("BASE_HREF", null); // string force a specific base URL (default is auto-detect)
|
|
|
|
_d("TRACE_FILE", null); // string file to log performance data into
|
|
|
|
_d("TRACE_THRESHOLD", 0.0); // float log pages which take more time than this many seconds
|
2024-01-04 14:50:36 +00:00
|
|
|
_d("TRUSTED_PROXIES", []); // array trust "X-Real-IP" / "X-Forwarded-For" / "X-Forwarded-Proto" headers from these IP ranges
|