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 5805279633
Some checks reported errors
continuous-integration/drone/push Build was killed
Release 2.26 which incorporates the following changes (#1)
- 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

Co-authored-by: Varakh <varakh@varakh.de>
Reviewed-on: #1
2023-04-06 20:55:21 +00: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 . "'";
}