Last active
December 28, 2015 07:59
-
-
Save mkdizajn/7468680 to your computer and use it in GitHub Desktop.
wordpress one config setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName www.some-host.io | |
SetEnv ENV "mk" | |
DocumentRoot /home/path/html | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( getenv ( 'ENV' ) == "mk" ){ | |
// your local dev server creds! | |
define('DB_NAME', 'user'); | |
define('DB_USER', 'root'); | |
define('DB_PASSWORD', 'pass1'); | |
define('DB_HOST', 'localhost'); | |
} else { | |
// live server creds! | |
define('DB_NAME', $_ENV['OPENSHIFT_APP_NAME']); | |
define('DB_USER', $_ENV['OPENSHIFT_MYSQL_DB_USERNAME']); | |
define('DB_PASSWORD', $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD']); | |
define('DB_HOST', $_ENV['OPENSHIFT_MYSQL_DB_HOST'] . ':' . $_ENV['OPENSHIFT_MYSQL_DB_PORT']); | |
} | |
/** MySQL hostname and other stuff lower .. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment