Created
October 3, 2013 00:11
-
-
Save luckyshot/6802531 to your computer and use it in GitHub Desktop.
Smart config.php Development / Production server
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 | |
define('DEBUG', in_array($_SERVER['HTTP_HOST'], array('127.0.0.1', 'localhost')) ); | |
if (DEBUG==false) { | |
// PRODUCTION SEVER | |
error_reporting(0); | |
define('APP_URL', 'http://www.example.com/'); | |
define('MYSQL_SERVER', 'localhost'); // | |
define('MYSQL_DATABASE', 'database'); // | |
define('MYSQL_USER', 'user'); // | |
define('MYSQL_PASS', 'pass'); // | |
}else{ | |
// DEVELOPMENT SERVER | |
error_reporting(E_ALL); | |
define('APP_URL', 'http://127.0.0.1/example/'); | |
define('MYSQL_SERVER', 'localhost'); // | |
define('MYSQL_DATABASE', 'database'); // | |
define('MYSQL_USER', 'user'); // | |
define('MYSQL_PASS', 'pass'); // | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment