Permalink
Browse files

Support multiple sites from one code base, first cut. Thanks, Sam.

git-svn-id: http://textpattern.googlecode.com/svn/development/4.0@3189 2fea6a4d-a838-0410-917b-93a53c48e9d2
  • Loading branch information...
1 parent f8cea4d commit c1ab4ea78a54ae294351920bfe3da08a9d0d82f9 @rwetzlmayr rwetzlmayr committed May 11, 2009
Showing with 34 additions and 11 deletions.
  1. +9 −4 css.php
  2. +17 −5 index.php
  3. +2 −0 textpattern/css.php
  4. +6 −2 textpattern/index.php
View
@@ -10,12 +10,17 @@
header('Content-type: text/css');
-if (!defined('txpath'))
+if (!defined("txpath"))
+{
define("txpath", dirname(__FILE__).'/textpattern');
+}
-ob_start(NULL, 2048);
-include txpath.'/config.php';
-ob_end_clean();
+if (!isset($txpcfg['table_prefix']))
+{
+ ob_start(NULL, 2048);
+ include txpath.'/config.php';
+ ob_end_clean();
+}
$nolog = 1;
define("txpinterface", "css");
View
@@ -12,14 +12,26 @@
foreach ( $_REQUEST as $name => $value )
unset($$name);
define("txpinterface", "public");
+
if (!defined('txpath'))
+ {
define("txpath", dirname(__FILE__).'/textpattern');
+ }
- // Use buffering to ensure bogus whitespace in config.php is ignored
- ob_start(NULL, 2048);
- $here = dirname(__FILE__);
- include txpath.'/config.php';
- ob_end_clean();
+ // save server path to site root
+ if (!isset($here))
+ {
+ $here = dirname(__FILE__);
+ }
+
+ // pull in config unless configuration data has already been provided (multi-headed use).
+ if (!isset($txpcfg['table_prefix']))
+ {
+ // Use buffering to ensure bogus whitespace in config.php is ignored
+ ob_start(NULL, 2048);
+ include txpath.'/config.php';
+ ob_end_clean();
+ }
include txpath.'/lib/constants.php';
include txpath.'/lib/txplib_misc.php';
View
@@ -8,7 +8,9 @@
*/
if (!defined("txpath"))
+{
define("txpath", dirname(__FILE__));
+}
require_once txpath.'/../css.php';
?>
@@ -17,14 +17,18 @@
foreach ( $_REQUEST as $name => $value )
unset($$name);
- define("txpath", dirname(__FILE__));
+ if (!defined('txpath'))
+ {
+ define("txpath", dirname(__FILE__));
+ }
+
define("txpinterface", "admin");
$thisversion = '4.0.8';
$txp_using_svn = true; // set false for releases
ob_start(NULL, 2048);
- if (!@include './config.php') {
+ if (!isset($txpcfg['table_prefix']) && !@include './config.php') {
ob_end_clean();
include txpath.'/setup/index.php';
exit();

0 comments on commit c1ab4ea

Please sign in to comment.