Forum

Thread tagged as: Question, Runway, Backup

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,
            ],

...
Toby Martin

Toby Martin 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

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?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, Perch 3 does this by default.