Varakh
5805279633
Some checks reported errors
continuous-integration/drone/push Build was killed
- 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
22 lines
488 B
PHP
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 . "'";
|
|
}
|