<?php

// The environment variable APP_ENV MUST be set
if (false === ($env = getenv('SYMFONY_ENV'))) {
    header("HTTP/1.0 500 Internal Server Error");
    echo "Internal Server Error. Missing environment configuration.";
    exit;
}

// Switch environment on AWS EBS
if (false !== getenv('APP_LOGS')) {
    if ('live' == $env) {
        $env = 'prod';
    } elseif ('test' == $env) {
        $env = 'staging';
    }
}

require 'app_' . $env . '.php';