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

23 lines
488 B
PHP
Raw Permalink Normal View History

#!/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 . "'";
}