wiki.techinc.nl/includes/Setup.php

69 lines
1.8 KiB
PHP
Raw Normal View History

2003-04-14 23:10:40 +00:00
<?
# The main wiki script and things like database
# conversion and maintenance scripts all share a
# common setup of including lots of classes and
# setting up a few globals.
#
global $IP;
include_once( "$IP/GlobalFunctions.php" );
include_once( "$IP/Namespace.php" );
include_once( "$IP/Skin.php" );
include_once( "$IP/OutputPage.php" );
include_once( "$IP/DifferenceEngine.php" );
include_once( "$IP/SearchEngine.php" );
include_once( "$IP/User.php" );
include_once( "$IP/LinkCache.php" );
include_once( "$IP/Title.php" );
include_once( "$IP/Article.php" );
include_once( "$IP/MagicWord.php" );
include_once( "$IP/MemCachedClient.inc.php" );
include_once( "$IP/Block.php" );
2003-04-14 23:10:40 +00:00
global $wgUser, $wgLang, $wgOut, $wgTitle;
global $wgArticle, $wgDeferredUpdateList, $wgLinkCache;
global $wgMemc, $wgMagicWords, $wgMwRedir;
class MemCachedClientforWiki extends MemCachedClient {
function _debug( $text ) {
wfDebug( "memcached: $text\n" );
}
}
$wgMemc = new MemCachedClientforWiki();
if( $wgUseMemCached ) {
$wgMemc->set_servers( $wgMemCachedServers );
2003-08-13 11:11:50 +00:00
$wgMemc->set_debug( $wgMemCachedDebug );
}
2003-04-14 23:10:40 +00:00
include_once( "$IP/Language.php" );
2003-04-14 23:10:40 +00:00
$wgOut = new OutputPage();
wfDebug( "\n\n" );
2003-04-14 23:10:40 +00:00
$wgLangClass = "Language" . ucfirst( $wgLanguageCode );
if( ! class_exists( $wgLangClass ) ) {
include_once( "$IP/LanguageUtf8.php" );
2003-04-14 23:10:40 +00:00
$wgLangClass = "LanguageUtf8";
}
$wgLang = new $wgLangClass();
if( !isset( $wgProfiling ) )
$wgProfiling = false;
if ( $wgProfiling ) {
include_once( "$IP/Profiling.php" );
} else {
function wfProfileIn( $fn ) {}
function wfProfileOut( $fn = "" ) {}
function wfGetProfilingOutput( $s, $e ) {}
function wfProfileClose() {}
}
$wgUser = User::loadFromSession();
2003-04-14 23:10:40 +00:00
$wgDeferredUpdateList = array();
$wgLinkCache = new LinkCache();
$wgMagicWords = array();
$wgMwRedir =& MagicWord::get( MAG_REDIRECT );
2003-04-14 23:10:40 +00:00
?>