Skip to content

Instantly share code, notes, and snippets.

@dennyhalim
Created January 31, 2010 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennyhalim/291072 to your computer and use it in GitHub Desktop.
Save dennyhalim/291072 to your computer and use it in GitHub Desktop.
<?php
/*
AM 10 August 2004
Choose a config file based on the access URL and load it
*/
require( dirname(__FILE__) . '/wp-includes/my-functions.php' );
// Default config file to use
#http://www.mertner.com/allan/?p=15
$configfile = '/config-default.php';
$user = get_virtual_user();
if ($user != "/") {
$configfile = '/config-' . $user . '.php';
}
if ( !file_exists( dirname(__FILE__) . '/' . $configfile) )
die("There doesn't seem to be a <code>" . $configfile . "</code> file. I need this before we can get started. Need more help? <a href='http://wordpress.org/docs/faq/#wp-config'>We got it</a>. You can <a href='wp-admin/setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.");
require_once( dirname(__FILE__) . '/' . $configfile);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment