Break UTF-8 support class from the case conversion tables; grab tables from memcached...
[lhc/web/wiklou.git] / includes / Setup.php
1 <?
2 # The main wiki script and things like database
3 # conversion and maintenance scripts all share a
4 # common setup of including lots of classes and
5 # setting up a few globals.
6 #
7
8 global $IP;
9 include_once( "$IP/GlobalFunctions.php" );
10 include_once( "$IP/Namespace.php" );
11 include_once( "$IP/Skin.php" );
12 include_once( "$IP/OutputPage.php" );
13 include_once( "$IP/DifferenceEngine.php" );
14 include_once( "$IP/SearchEngine.php" );
15 include_once( "$IP/User.php" );
16 include_once( "$IP/LinkCache.php" );
17 include_once( "$IP/Title.php" );
18 include_once( "$IP/Article.php" );
19 include_once( "$IP/MemCachedClient.inc.php" );
20
21 wfDebug( "\n\n" );
22
23 global $wgUser, $wgLang, $wgOut, $wgTitle;
24 global $wgArticle, $wgDeferredUpdateList, $wgLinkCache;
25 global $wgMemc;
26
27 class MemCachedClientforWiki extends MemCachedClient {
28 function _debug( $text ) {
29 wfDebug( "memcached: $text\n" );
30 }
31 }
32
33 $wgMemc = new MemCachedClientforWiki();
34 if( $wgUseMemCached ) {
35 $wgMemc->set_servers( $wgMemCachedServers );
36 $wgMemc->set_debug( $wgMemCachedDebug );
37 }
38
39 include_once( "$IP/Language.php" );
40
41 $wgOut = new OutputPage();
42 $wgLangClass = "Language" . ucfirst( $wgLanguageCode );
43 if( ! class_exists( $wgLangClass ) ) {
44 include_once( "$IP/LanguageUtf8.php" );
45 $wgLangClass = "LanguageUtf8";
46 }
47 $wgLang = new $wgLangClass();
48
49 $wgUser = User::loadFromSession();
50 $wgDeferredUpdateList = array();
51 $wgLinkCache = new LinkCache();
52
53 ?>