From e9d43ec4f51eb8c3d3fcbc20825db1395b8e14f2 Mon Sep 17 00:00:00 2001 From: Tom Clarke Date: Tue, 8 Aug 2017 23:55:24 +0100 Subject: [PATCH] Adding environment support - #13. Adding 'disallow_file_mods' support - #14 --- app/config/parameters.yml.dist | 2 ++ wp-config.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 2ca2535..f355d64 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -4,5 +4,7 @@ parameters: db_password: root db_host: localhost debug: true + environment: + disallow_file_mods: false dbi_aws_access_key_id: dbi_aws_secret_access_key: \ No newline at end of file diff --git a/wp-config.php b/wp-config.php index d479d0f..cf14a52 100644 --- a/wp-config.php +++ b/wp-config.php @@ -84,6 +84,25 @@ define( 'SCRIPT_DEBUG', $var['debug'] ); } +// ======================================== +// Environment +// ======================================== +if (!file_exists($parameters)) { + define( 'ENVIRONMENT', getenv('ENVIRONMENT') ); +} else { + define( 'ENVIRONMENT', $var['ENVIRONMENT'] ); +} + +// ============================================================= +// Disallow File Mods - Stop users being able to install plugins +// For more information: http://bit.ly/2unkVoG +// ============================================================= +if (!file_exists($parameters)) { + define( 'DISALLOW_FILE_MODS', getenv('disallow_file_mods') ); +} else { + define( 'DISALLOW_FILE_MODS', $var['disallow_file_mods'] ); +} + // ======================================= // WordPress SMTP server // Enable mailing on Heroku using sendgrid