From 60861760fc3bdc1cdea407e8ee21eb8c54e77b8f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 7 Apr 2009 17:10:54 -0400 Subject: Host multiple sites with the same codebase This is the beginning of the code for status.net and related status farms. It will read basic information about a site from a shared, central database and use the data stored there to switch on the hostname. --- classes/Status_network.php | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 classes/Status_network.php (limited to 'classes/Status_network.php') diff --git a/classes/Status_network.php b/classes/Status_network.php new file mode 100755 index 000000000..f7747f71d --- /dev/null +++ b/classes/Status_network.php @@ -0,0 +1,61 @@ +dbhost)) ? 'localhost' : $sn->dbhost; + $dbuser = (empty($sn->dbuser)) ? $sn->nickname : $sn->dbuser; + $dbpass = $sn->dbpass; + $dbname = (empty($sn->dbname)) ? $sn->nickname : $sn->dbname; + + $config['db']['database'] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname"; + $config['site']['name'] = $sn->sitename; + return true; + } else { + return false; + } + } +} -- cgit v1.2.3-54-g00ecf