Skip to content

Commit

Permalink
DRY up environment configs
Browse files Browse the repository at this point in the history
  • Loading branch information
swalkinshaw committed Apr 17, 2015
1 parent f99a273 commit 8a0eab1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
10 changes: 10 additions & 0 deletions config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
require_once $env_config;
}

/**
* URLs
*/
define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));

/**
* Custom Content Directory
*/
Expand All @@ -33,6 +39,10 @@
/**
* DB settings
*/
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST') ? getenv('DB_HOST') : 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
$table_prefix = getenv('DB_PREFIX') ? getenv('DB_PREFIX') : 'wp_';
Expand Down
8 changes: 0 additions & 8 deletions config/environments/development.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?php
/* Development */
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST') ? getenv('DB_HOST') : 'localhost');

define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));

define('SAVEQUERIES', true);
define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
8 changes: 0 additions & 8 deletions config/environments/production.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?php
/* Production */
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST') ? getenv('DB_HOST') : 'localhost');

define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));

ini_set('display_errors', 0);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', false);
Expand Down
8 changes: 0 additions & 8 deletions config/environments/staging.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?php
/* Staging */
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST') ? getenv('DB_HOST') : 'localhost');

define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));

ini_set('display_errors', 0);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', false);
Expand Down

0 comments on commit 8a0eab1

Please sign in to comment.