Wordpress wp-config.php with several environment configurations.
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "wp-config.php" and fill in the values.
*
* @package WordPress
*/
// start session
if (!session_id()){
session_start();
}
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
//config customizada do wordpress
//Define as url inves de usar as do banco
defined('WP_SITEURL')
|| define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
defined('WP_HOME')
|| define('WP_HOME', WP_SITEURL);
//defined('THEME_URL')
// || define('THEME_URL', WP_SITEURL . '/wp-content/themes/mytheme/');
//configuracao dependente de ambiente
switch(APPLICATION_ENV) {
case 'production':
@ini_set('log_errors', 'On');
@ini_set('display_errors', 'Off');
define('WP_DEBUG', false);
$db_name = 'x';
$db_user = 'x';
$db_password = 'x';
$db_host = 'x.x.x';
break;
case 'staging':
@ini_set('log_errors', 'On');
@ini_set('display_errors', 'Off');
@error_reporting(E_NOTICE ^ E_DEPRECATED);
define('WP_DEBUG', false);
$db_name = 'x';
$db_user = 'x';
$db_password = 'x';
$db_host = 'x.x.x';
break;
default:
ini_set('log_errors', 'On');
ini_set('display_errors', 'On');
define('WP_DEBUG', false);
$db_name = 'x';
$db_user = 'root';
$db_password = 'root';
$db_host = 'localhost';
break;
}
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', $db_name);
/** MySQL database username */
define('DB_USER', $db_user);
/** MySQL database password */
define('DB_PASSWORD', $db_password);
/** MySQL hostname */
define('DB_HOST', $db_host);
/** 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', '');
/** Facebook Keys */
define('FB_APPID', 'x');
define('FB_SECRET', 'x');
define('FB_REDIRECT', 'x');
/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', '2Y0T!(%aQVUr-&2uj v9-t|!5JAhAU$GB,sko>n@zvJ7Eu4qO^fz,z|EoZbKiHn#');
define('SECURE_AUTH_KEY', 'rABNua>gg Ju?UAqMT@cEzh$hxCIyl!$cw7#Ro+ry=>Aj,{7:WFidyWc|c!7q?s3');
define('LOGGED_IN_KEY', 'W*i;w,Q)mgM&1^fm${m,a]=)g5P+p*R+TWo-_Ao^6[s4tO&Lg7;%c}PuY[f/`gDs');
define('NONCE_KEY', 'g $ExIW+~ACX&7Bq0iKZfNsE(r_e)99Y[VK1L|ae;v#X.Qxgfhu!WR^v4*IE?9%~');
define('AUTH_SALT', 'M-B!,9v6B*u2<m:lN5vxCObfp,z5o}P^z-i1=@0A!xfSN|8j?hY6MGl.h$7&}1Br');
define('SECURE_AUTH_SALT', 'ST9-_Bq-LQTcDm$aO:lB@^ab*6`v,z1N-U6|]%e8@@@|j*r@-?VW.Vj>Bx?2|RV%');
define('LOGGED_IN_SALT', ';#vY& <O?.pH1/g1;<kac[-umt7mXS0xstiL+1ML=Wg|D/4(?`7h|+;>?rLX Jb#');
define('NONCE_SALT', '8+kaKB$+;/KlV!+4r<+pTJ=e-saOllgm_9BG,|*F}UD0 Tu*` ^;Q=H4I:-(-!Cq');
/**#@-*/
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
* language support.
*/
define('WPLANG', 'pt_BR');
// disable post revisions
define('AUTOSAVE_INTERVAL', 300 ); // seconds
define('WP_POST_REVISIONS', false );
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');