If you are developing locally with the domain local.testing.dev where ‘local’ would determine the use of the local connections. You can change local to any string that exists in your development environment’s domain name that does not exist in the production environment.
if(strpos($_SERVER['HTTP_HOST'], 'local') === false){
define('DB_NAME', 'database_name');
define('DB_USER', 'user_name');
define('DB_PASSWORD', 'password');
define('WP_DEBUG', false);
/** WP Memory Limit */
define('WP_MEMORY_LIMIT', '1024M');
/** Limit number of post revisions */
define( 'WP_POST_REVISIONS', 5);
/** Turn Off PHP Error Reporting */
error_reporting(0);
@ini_set(‘display_errors’, 0);
}
if(strpos($_SERVER['HTTP_HOST'], 'local') >= 0){
define('DB_NAME', 'database_name');
define('DB_USER', 'user_name');
define('DB_PASSWORD', 'password');
define('WP_DEBUG', true);
}
define('FS_METHOD', 'direct'); // For plugin updates etc.