diff --git a/.env.dist b/.env.dist index 4a0e994..cbe7d5d 100644 --- a/.env.dist +++ b/.env.dist @@ -8,6 +8,7 @@ # # Real environment variables win over .env files. +# PROD / DEV APP_MODE=DEV APP_COMPONENTS_FILE=config/app.php APP_NODES_FILE=config/nodes.php diff --git a/public/index.php b/public/index.php index 823cc96..7a18eaf 100644 --- a/public/index.php +++ b/public/index.php @@ -12,9 +12,6 @@ require_once dirname(__DIR__).'/vendor/autoload.php'; (new Symfony\Component\Dotenv\Dotenv())->usePutenv()->loadEnv(dirname(__DIR__).'/.env'); error_reporting(0); ini_set('display_errors','Off'); -if(getenv("APP_MODE") == 'ERR'){ - error_reporting(E_ALL); ini_set('display_errors','On'); -} $request = ServerRequestFactory::fromGlobals(); @@ -22,8 +19,7 @@ $app = new App(); $response = $app->handler($request, (new Response())->withHeader("Content-Type", "text/html; charset=utf-8")); (new ResponseEmitter())->emit($response); - -if(($response->getStatusCode() !== 200 && getenv("APP_MODE") == 'DEV') || in_array("Dev", $response->getHeader("App-Mode"))){ +if(($response->getStatusCode() !== 200 && getenv("APP_MODE") != 'PROD') || in_array("Dev", $response->getHeader("App-Mode"))){ $app->syslogger()->dump("Response", $response); addShutdownInfo($app->syslogger()->getLogs()); } \ No newline at end of file