Archived
1
0
Fork 0
This repository has been archived on 2023-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
ts3web/docker/configure.php
Varakh f6db46234a Release 2.26 which incorporates the following changes
- Add a ENV_DIR for docker containers to allow changing the env file location changes where the rest of the configuration is bootstrapped from
- Add log_dir and snapshot_dir in env file configuration to determine the log and snapshot directories
- Massively cleaned up README and provide better examples
2023-04-06 22:53:19 +02:00

22 lines
488 B
PHP

#!/usr/bin/env php
<?php
echo "Adapting ENV_DIR..." . PHP_EOL;
$path = '/etc/php7/php-fpm.d/www.conf';
$env = "ENV_DIR";
$fileContent = file_get_contents($path);
$fileContent = preg_replace("/%%%" . strtoupper($env) . "%%%/", env($env, "/var/www/html/application/config"), $fileContent);
file_put_contents($path, $fileContent);
function env($name, $default = null)
{
$v = getenv($name) ?: $default;
if ($v === null) {
return "''";
}
return "'" . $v . "'";
}