Simple PIREP overview page (map not working atm)

This commit is contained in:
Nabeel Shahzad
2017-12-19 15:19:06 -06:00
parent 45d12c82ba
commit f2131093c4
14 changed files with 272 additions and 326 deletions

View File

@@ -80,6 +80,30 @@ class EnvironmentService
return $opts;
}
/**
* Update a key/value pair in the env file
* @param $key
* @param $value
*/
public static function changeEnvironmentVariable($key, $value, $quoted=false)
{
$env_file = \App::environmentFilePath();
if (\is_bool(env($key))) {
$old = env($key) ? 'true' : 'false';
}
if($quoted) {
$value = '"'.$value.'"';
}
if (file_exists($env_file)) {
file_put_contents($env_file, str_replace(
"$key=" . $old, "$key=" . $value, file_get_contents($env_file)
));
}
}
/**
* Get the template file name and write it out
* @param $opts