Forum
Configuring Temp Folder For Backups Between Local/Staging/Production
Is the best way to configure the temp folder in runway.php
for different environments as follows:
$host = $_SERVER['HTTP_HOST'];
if ($host == 'loc.example:8888') {
$path = '/local/path/to/temp';
} elseif ($host == 'stagingdomain.creativemonster.co.uk') {
$path = '/staging/path/to/temp';
} else {
$path = '/production/path/to/temp';
}
return [
'env' => [
'temp_folder' => $path,
],
...
Is that working? If so, I don't see a problem.
A neater way might be to define it in your environment-specific config file.
Ah okay, but I would still have to conditionally include the specific environment-specific config file using a similar technique though wouldn't I?
Yes, Perch 3 does this by default.