// Check to see if we are at the file scope
if ( !isset( $wgVersion ) ) {
- die( "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n" );
+ echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
+ die( -1 );
}
if( !isset( $wgProfiling ) )
require_once( 'ObjectCache.php' );
require_once( 'WikiError.php' );
require_once( 'SpecialPage.php' );
-require_once( 'RequestRate.php' );
if ( $wgUseDynamicDates ) {
require_once( 'DateFormatter.php' );
wfProfileIn( $fname.'-SetupSession' );
if ( $wgDBprefix ) {
- session_name( $wgDBname . '_' . $wgDBprefix . '_session' );
+ $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
+} elseif ( $wgSharedDB ) {
+ $wgCookiePrefix = $wgSharedDB;
} else {
- session_name( $wgDBname . '_session' );
+ $wgCookiePrefix = $wgDBname;
}
-if( !$wgCommandLineMode && ( isset( $_COOKIE[session_name()] ) || isset( $_COOKIE[$wgDBname.'Token'] ) ) ) {
+# If session.auto_start is there, we can't touch session name
+#
+if (!ini_get('session.auto_start')) {
+ session_name( $wgCookiePrefix . '_session' );
+}
+
+if( !$wgCommandLineMode && ( isset( $_COOKIE[session_name()] ) || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
wfIncrStats( 'request_with_session' );
User::SetupSession();
$wgSessionStarted = true;
$wgLang = &$wgContLang;
} else {
wfSuppressWarnings();
+ // Preload base classes to work around APC/PHP5 bug
+ include_once("$IP/languages/$wgLangClass.deps.php");
include_once("$IP/languages/$wgLangClass.php");
wfRestoreWarnings();
$wgTitle = Title::makeTitle( NS_SPECIAL, 'Error' );
$wgArticle = new Article($wgTitle);
-# Update request rate
-/*
-if ( !mt_rand( 0, $wgRequestRateDefaultFraction - 1 ) ) {
- require_once( 'RequestRate.php' );
- $rr =& RequestRate::singleton();
- $rr->increment();
-}*/
-
wfProfileOut( $fname.'-misc2' );
wfProfileIn( $fname.'-extensions' );