Skip to content

Instantly share code, notes, and snippets.

@ethangardner
Created January 29, 2016 19:17
Show Gist options
  • Select an option

  • Save ethangardner/87421ab626fe5ec5725a to your computer and use it in GitHub Desktop.

Select an option

Save ethangardner/87421ab626fe5ec5725a to your computer and use it in GitHub Desktop.
<?php
// this file lives in the site's theme directory
if( defined( 'EMA_ENVIRONMENT' ) !== true || constant( 'EMA_ENVIRONMENT' ) === 'prod' ) { {
// do stuff
} ?>
<?php
// this file lives in the web root directory
if( file_exists( dirname(__FILE__) . '/../' . basename(__DIR__) . '-env-config.php' ) ){
require_once( dirname(__FILE__) . '/../' . basename(__DIR__) . '-env-config.php' );
} else {
define( 'EMA_ENVIROMENT', 'prod' );
}
// ** MySQL settings ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress_database_name');
/** MySQL database username */
define('DB_USER', 'the_db_user');
/** MySQL database password */
define('DB_PASSWORD', 'the_db_password');
/** MySQL hostname */
define('DB_HOST', 'localhost_or_whatever_it_is');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
/** Blah, blah, blah. Rest of the file goes below ...
<?php
// This file lives one level up from the directory containing wp-config.php
// and is not in version control. This file is completely omitted from production
// deployments.
define( 'EMA_ENVIRONMENT', 'stage' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment