aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--img_auth.php173
-rw-r--r--includes/DatabasePostgreSQL.php547
-rw-r--r--languages/LanguageLatin1.php252
-rw-r--r--languages/Names.php204
-rw-r--r--maintenance/postgresql/pg_tables.sql587
-rw-r--r--stylesheets/myskin/main.css1
6 files changed, 1764 insertions, 0 deletions
diff --git a/img_auth.php b/img_auth.php
new file mode 100644
index 000000000000..02240ceea9e1
--- /dev/null
+++ b/img_auth.php
@@ -0,0 +1,173 @@
+<?php
+# Image download authorisation script
+# To use, in LocalSettings.php set $wgUploadDirectory to point to a non-public directory, and
+# $wgUploadPath to point to this file. Also set $wgWhitelistRead to an array of pages you want
+# everyone to be able to access. Your server must support PATH_INFO, CGI-based configurations
+# generally don't.
+
+define( "MEDIAWIKI", true );
+require_once( "./LocalSettings.php" );
+require_once( "includes/Setup.php" );
+
+# Get filenames/directories
+$filename = realpath( $wgUploadDirectory . $_SERVER['PATH_INFO'] );
+$realUploadDirectory = realpath( $wgUploadDirectory );
+$imageName = $wgLang->getNsText( NS_IMAGE ) . ":" . basename( $_SERVER['PATH_INFO'] );
+
+# Check if the filename is in the correct directory
+if ( substr( $filename, 0, strlen( $realUploadDirectory ) ) != $realUploadDirectory ) {
+ wfForbidden();
+}
+
+if ( is_array( $wgWhitelistRead ) && !in_array( $imageName, $wgWhitelistRead ) && !$wgUser->getID() ) {
+ wfForbidden();
+}
+
+# Write file
+$type = wfGetType( $filename );
+if ( $type ) {
+ header("Content-type: $type");
+}
+
+readfile( $filename );
+
+function wfGetType( $filename ) {
+ # There's probably a better way to do this
+ $types = <<<END_STRING
+application/andrew-inset ez
+application/mac-binhex40 hqx
+application/mac-compactpro cpt
+application/mathml+xml mathml
+application/msword doc
+application/octet-stream bin dms lha lzh exe class so dll
+application/oda oda
+application/ogg ogg
+application/pdf pdf
+application/postscript ai eps ps
+application/rdf+xml rdf
+application/smil smi smil
+application/srgs gram
+application/srgs+xml grxml
+application/vnd.mif mif
+application/vnd.ms-excel xls
+application/vnd.ms-powerpoint ppt
+application/vnd.wap.wbxml wbxml
+application/vnd.wap.wmlc wmlc
+application/vnd.wap.wmlscriptc wmlsc
+application/voicexml+xml vxml
+application/x-bcpio bcpio
+application/x-cdlink vcd
+application/x-chess-pgn pgn
+application/x-cpio cpio
+application/x-csh csh
+application/x-director dcr dir dxr
+application/x-dvi dvi
+application/x-futuresplash spl
+application/x-gtar gtar
+application/x-hdf hdf
+application/x-javascript js
+application/x-koan skp skd skt skm
+application/x-latex latex
+application/x-netcdf nc cdf
+application/x-sh sh
+application/x-shar shar
+application/x-shockwave-flash swf
+application/x-stuffit sit
+application/x-sv4cpio sv4cpio
+application/x-sv4crc sv4crc
+application/x-tar tar
+application/x-tcl tcl
+application/x-tex tex
+application/x-texinfo texinfo texi
+application/x-troff t tr roff
+application/x-troff-man man
+application/x-troff-me me
+application/x-troff-ms ms
+application/x-ustar ustar
+application/x-wais-source src
+application/xhtml+xml xhtml xht
+application/xslt+xml xslt
+application/xml xml xsl
+application/xml-dtd dtd
+application/zip zip
+audio/basic au snd
+audio/midi mid midi kar
+audio/mpeg mpga mp2 mp3
+audio/x-aiff aif aiff aifc
+audio/x-mpegurl m3u
+audio/x-pn-realaudio ram rm
+audio/x-pn-realaudio-plugin rpm
+audio/x-realaudio ra
+audio/x-wav wav
+chemical/x-pdb pdb
+chemical/x-xyz xyz
+image/bmp bmp
+image/cgm cgm
+image/gif gif
+image/ief ief
+image/jpeg jpeg jpg jpe
+image/png png
+image/svg+xml svg
+image/tiff tiff tif
+image/vnd.djvu djvu djv
+image/vnd.wap.wbmp wbmp
+image/x-cmu-raster ras
+image/x-icon ico
+image/x-portable-anymap pnm
+image/x-portable-bitmap pbm
+image/x-portable-graymap pgm
+image/x-portable-pixmap ppm
+image/x-rgb rgb
+image/x-xbitmap xbm
+image/x-xpixmap xpm
+image/x-xwindowdump xwd
+model/iges igs iges
+model/mesh msh mesh silo
+model/vrml wrl vrml
+text/calendar ics ifb
+text/css css
+text/html html htm
+text/plain asc txt
+text/richtext rtx
+text/rtf rtf
+text/sgml sgml sgm
+text/tab-separated-values tsv
+text/vnd.wap.wml wml
+text/vnd.wap.wmlscript wmls
+text/x-setext etx
+video/mpeg mpeg mpg mpe
+video/quicktime qt mov
+video/vnd.mpegurl mxu
+video/x-msvideo avi
+video/x-sgi-movie movie
+x-conference/x-cooltalk ice";
+END_STRING;
+ $endl = "
+";
+ $types = explode( $endl, $types );
+ if ( !preg_match( "/\.(.*?)$/", $filename, $matches ) ) {
+ return false;
+ }
+
+ foreach( $types as $type ) {
+ $extensions = explode( " ", $type );
+ for ( $i=1; $i<count( $extensions ); $i++ ) {
+ if ( $extensions[$i] == $matches[1] ) {
+ return $extensions[0];
+ }
+ }
+ }
+ return false;
+}
+
+function wfForbidden() {
+ header( "HTTP/1.0 403 Forbidden" );
+ print
+"<html><body>
+<h1>Access denied</h1>
+<p>You need to log in to access files on this server</p>
+</body></html>";
+ exit;
+}
+
+?>
diff --git a/includes/DatabasePostgreSQL.php b/includes/DatabasePostgreSQL.php
new file mode 100644
index 000000000000..80c762ad3cb3
--- /dev/null
+++ b/includes/DatabasePostgreSQL.php
@@ -0,0 +1,547 @@
+<?php
+# $Id$
+#
+# DO NOT USE !!! Unless you want to help developping it.
+#
+# This file is an attempt to port the mysql database layer to postgreSQL. The
+# only thing done so far is s/mysql/pg/ and dieing if function haven't been
+# ported.
+#
+# As said brion 07/06/2004 :
+# "table definitions need to be changed. fulltext index needs to work differently
+# things that use the last insert id need to be changed. Probably other things
+# need to be changed. various semantics may be different."
+#
+# Hashar
+
+require_once( "FulltextStoplist.php" );
+require_once( "CacheManager.php" );
+
+define( "DB_READ", -1 );
+define( "DB_WRITE", -2 );
+define( "DB_LAST", -3 );
+
+define( "LIST_COMMA", 0 );
+define( "LIST_AND", 1 );
+define( "LIST_SET", 2 );
+
+class Database {
+
+#------------------------------------------------------------------------------
+# Variables
+#------------------------------------------------------------------------------
+ /* private */ var $mLastQuery = "";
+ /* private */ var $mBufferResults = true;
+ /* private */ var $mIgnoreErrors = false;
+
+ /* private */ var $mServer, $mUser, $mPassword, $mConn, $mDBname;
+ /* private */ var $mOut, $mDebug, $mOpened = false;
+
+ /* private */ var $mFailFunction;
+ /* private */ var $mLastResult;
+
+#------------------------------------------------------------------------------
+# Accessors
+#------------------------------------------------------------------------------
+ # Set functions
+ # These set a variable and return the previous state
+
+ # Fail function, takes a Database as a parameter
+ # Set to false for default, 1 for ignore errors
+ function setFailFunction( $function ) { return wfSetVar( $this->mFailFunction, $function ); }
+
+ # Output page, used for reporting errors
+ # FALSE means discard output
+ function &setOutputPage( &$out ) { $this->mOut =& $out; }
+
+ # Boolean, controls output of large amounts of debug information
+ function setDebug( $debug ) { return wfSetVar( $this->mDebug, $debug ); }
+
+ # Turns buffering of SQL result sets on (true) or off (false). Default is
+ # "on" and it should not be changed without good reasons.
+ function setBufferResults( $buffer ) { return wfSetVar( $this->mBufferResults, $buffer ); }
+
+ # Turns on (false) or off (true) the automatic generation and sending
+ # of a "we're sorry, but there has been a database error" page on
+ # database errors. Default is on (false). When turned off, the
+ # code should use wfLastErrno() and wfLastError() to handle the
+ # situation as appropriate.
+ function setIgnoreErrors( $ignoreErrors ) { return wfSetVar( $this->mIgnoreErrors, $ignoreErrors ); }
+
+ # Get functions
+
+ function lastQuery() { return $this->mLastQuery; }
+ function isOpen() { return $this->mOpened; }
+
+#------------------------------------------------------------------------------
+# Other functions
+#------------------------------------------------------------------------------
+
+ function Database()
+ {
+ global $wgOut;
+ # Can't get a reference if it hasn't been set yet
+ if ( !isset( $wgOut ) ) {
+ $wgOut = NULL;
+ }
+ $this->mOut =& $wgOut;
+
+ }
+
+ /* static */ function newFromParams( $server, $user, $password, $dbName,
+ $failFunction = false, $debug = false, $bufferResults = true, $ignoreErrors = false )
+ {
+ $db = new Database;
+ $db->mFailFunction = $failFunction;
+ $db->mIgnoreErrors = $ignoreErrors;
+ $db->mDebug = $debug;
+ $db->mBufferResults = $bufferResults;
+ $db->open( $server, $user, $password, $dbName );
+ return $db;
+ }
+
+ # Usually aborts on failure
+ # If the failFunction is set to a non-zero integer, returns success
+ function open( $server, $user, $password, $dbName )
+ {
+ global $wgEmergencyContact;
+
+ $this->close();
+ $this->mServer = $server;
+ $this->mUser = $user;
+ $this->mPassword = $password;
+ $this->mDBname = $dbName;
+
+ $success = false;
+
+
+ if ( "" != $dbName ) {
+ # start a database connection
+ @$this->mConn = pg_connect("host=$server dbname=$dbName user=$user password=$password");
+ if ( $this->mConn == false ) {
+ wfDebug( "DB connection error\n" );
+ wfDebug( "Server: $server, Database: $dbName, User: $user, Password: " . substr( $password, 0, 3 ) . "...\n" );
+ wfDebug( $this->lastError()."\n" );
+ }
+ }
+ return $this->mConn;
+ }
+
+ # Closes a database connection, if it is open
+ # Returns success, true if already closed
+ function close()
+ {
+ $this->mOpened = false;
+ if ( $this->mConn ) {
+ return pg_close( $this->mConn );
+ } else {
+ return true;
+ }
+ }
+
+ /* private */ function reportConnectionError( $msg = "")
+ {
+ if ( $this->mFailFunction ) {
+ if ( !is_int( $this->mFailFunction ) ) {
+ $this->$mFailFunction( $this );
+ }
+ } else {
+ wfEmergencyAbort( $this );
+ }
+ }
+
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns success
+ function query( $sql, $fname = "" )
+ {
+ global $wgProfiling;
+
+ if ( $wgProfiling ) {
+ # generalizeSQL will probably cut down the query to reasonable
+ # logging size most of the time. The substr is really just a sanity check.
+ $profName = "query: " . substr( Database::generalizeSQL( $sql ), 0, 255 );
+ wfProfileIn( $profName );
+ }
+
+ $this->mLastQuery = $sql;
+
+ if ( $this->mDebug ) {
+ $sqlx = substr( $sql, 0, 500 );
+ $sqlx = wordwrap(strtr($sqlx,"\t\n"," "));
+ wfDebug( "SQL: $sqlx\n" );
+ }
+
+ $ret = pg_query( $this->mConn , $sql);
+ $this->mLastResult = $ret;
+ if ( false == $ret ) {
+ $error = pg_last_error( $this->mConn );
+ // TODO FIXME : no error number function in postgre
+ // $errno = mysql_errno( $this->mConn );
+ if( $this->mIgnoreErrors ) {
+ wfDebug("SQL ERROR (ignored): " . $error . "\n");
+ } else {
+ wfDebug("SQL ERROR: " . $error . "\n");
+ if ( $this->mOut ) {
+ // this calls wfAbruptExit()
+ $this->mOut->databaseError( $fname, $sql, $error, 0 );
+ }
+ }
+ }
+
+ if ( $wgProfiling ) {
+ wfProfileOut( $profName );
+ }
+ return $ret;
+ }
+
+ function freeResult( $res ) {
+ if ( !@pg_free_result( $res ) ) {
+ wfDebugDieBacktrace( "Unable to free PostgreSQL result\n" );
+ }
+ }
+ function fetchObject( $res ) {
+ @$row = pg_fetch_object( $res );
+ # FIXME: HACK HACK HACK HACK debug
+
+ # TODO:
+ # hashar : not sure if the following test really trigger if the object
+ # fetching failled.
+ if( pg_last_error($this->mConn) ) {
+ wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_last_error($this->mConn) ) );
+ }
+ return $row;
+ }
+
+ function fetchRow( $res ) {
+ @$row = pg_fetch_array( $res );
+ if( pg_last_error($this->mConn) ) {
+ wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_last_error($this->mConn) ) );
+ }
+ return $row;
+ }
+
+ function numRows( $res ) {
+ @$n = pg_num_rows( $res );
+ if( pg_last_error($this->mConn) ) {
+ wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_last_error($this->mConn) ) );
+ }
+ return $n;
+ }
+ function numFields( $res ) { return pg_num_fields( $res ); }
+ function fieldName( $res, $n ) { return pg_field_name( $res, $n ); }
+ // TODO FIXME: need to implement something here
+ function insertId() {
+ //return mysql_insert_id( $this->mConn );
+ wfDebugDieBacktrace( "Database::insertId() error : not implemented for postgre, use sequences" );
+ }
+ function dataSeek( $res, $row ) { return pg_result_seek( $res, $row ); }
+ function lastErrno() { return $this->lastError(); }
+ function lastError() { return pg_last_error(); }
+ function affectedRows() {
+ return pg_affected_rows( $this->mLastResult );
+ }
+
+ # Simple UPDATE wrapper
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns success
+ function set( $table, $var, $value, $cond, $fname = "Database::set" )
+ {
+ $sql = "UPDATE \"$table\" SET \"$var\" = '" .
+ wfStrencode( $value ) . "' WHERE ($cond)";
+ return !!$this->query( $sql, DB_WRITE, $fname );
+ }
+
+ # Simple SELECT wrapper, returns a single field, input must be encoded
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns FALSE on failure
+ function get( $table, $var, $cond, $fname = "Database::get" )
+ {
+ $from=$table?" FROM \"$table\" ":"";
+ $where=$cond?" WHERE ($cond)":"";
+
+ $sql = "SELECT $var $from $where";
+
+ $result = $this->query( $sql, DB_READ, $fname );
+
+ $ret = "";
+ if ( pg_num_rows( $result ) > 0 ) {
+ $s = pg_fetch_array( $result );
+ $ret = $s[0];
+ pg_free_result( $result );
+ }
+ return $ret;
+ }
+
+ # More complex SELECT wrapper, single row only
+ # Aborts or returns FALSE on error
+ # Takes an array of selected variables, and a condition map, which is ANDed
+ # e.g. getArray( "cur", array( "cur_id" ), array( "cur_namespace" => 0, "cur_title" => "Astronomy" ) )
+ # would return an object where $obj->cur_id is the ID of the Astronomy article
+ function getArray( $table, $vars, $conds, $fname = "Database::getArray" )
+ {
+ $vars = implode( ",", $vars );
+ $where = Database::makeList( $conds, LIST_AND );
+ $sql = "SELECT \"$vars\" FROM \"$table\" WHERE $where LIMIT 1";
+ $res = $this->query( $sql, $fname );
+ if ( $res === false || !$this->numRows( $res ) ) {
+ return false;
+ }
+ $obj = $this->fetchObject( $res );
+ $this->freeResult( $res );
+ return $obj;
+ }
+
+ # Removes most variables from an SQL query and replaces them with X or N for numbers.
+ # It's only slightly flawed. Don't use for anything important.
+ /* static */ function generalizeSQL( $sql )
+ {
+ # This does the same as the regexp below would do, but in such a way
+ # as to avoid crashing php on some large strings.
+ # $sql = preg_replace ( "/'([^\\\\']|\\\\.)*'|\"([^\\\\\"]|\\\\.)*\"/", "'X'", $sql);
+
+ $sql = str_replace ( "\\\\", "", $sql);
+ $sql = str_replace ( "\\'", "", $sql);
+ $sql = str_replace ( "\\\"", "", $sql);
+ $sql = preg_replace ("/'.*'/s", "'X'", $sql);
+ $sql = preg_replace ('/".*"/s', "'X'", $sql);
+
+ # All newlines, tabs, etc replaced by single space
+ $sql = preg_replace ( "/\s+/", " ", $sql);
+
+ # All numbers => N
+ $sql = preg_replace ('/-?[0-9]+/s', "N", $sql);
+
+ return $sql;
+ }
+
+ # Determines whether a field exists in a table
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns NULL on failure
+ function fieldExists( $table, $field, $fname = "Database::fieldExists" )
+ {
+ $res = $this->query( "DESCRIBE '$table'", DB_READ, $fname );
+ if ( !$res ) {
+ return NULL;
+ }
+
+ $found = false;
+
+ while ( $row = $this->fetchObject( $res ) ) {
+ if ( $row->Field == $field ) {
+ $found = true;
+ break;
+ }
+ }
+ return $found;
+ }
+
+ # Determines whether an index exists
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns NULL on failure
+ function indexExists( $table, $index, $fname = "Database::indexExists" )
+ {
+ $sql = "SELECT indexname FROM pg_indexes WHERE tablename='$table'";
+ $res = $this->query( $sql, DB_READ, $fname );
+ if ( !$res ) {
+ return NULL;
+ }
+
+ $found = false;
+
+ while ( $row = $this->fetchObject( $res ) ) {
+ if ( $row->Key_name == $index ) {
+ $found = true;
+ break;
+ }
+ }
+ return $found;
+ }
+
+ function tableExists( $table )
+ {
+ $old = $this->mIgnoreErrors;
+ $this->mIgnoreErrors = true;
+ $res = $this->query( "SELECT 1 FROM '$table' LIMIT 1" );
+ $this->mIgnoreErrors = $old;
+ if( $res ) {
+ $this->freeResult( $res );
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ function fieldInfo( $table, $field )
+ {
+ $res = $this->query( "SELECT * FROM '$table' LIMIT 1" );
+ $n = pg_num_fields( $res );
+ for( $i = 0; $i < $n; $i++ ) {
+ // FIXME
+ wfDebugDieBacktrace( "Database::fieldInfo() error : mysql_fetch_field() not implemented for postgre" );
+ $meta = mysql_fetch_field( $res, $i );
+ if( $field == $meta->name ) {
+ return $meta;
+ }
+ }
+ return false;
+ }
+
+ # INSERT wrapper, inserts an array into a table
+ # Keys are field names, values are values
+ # Usually aborts on failure
+ # If errors are explicitly ignored, returns success
+ function insertArray( $table, $a, $fname = "Database::insertArray" )
+ {
+ $sql1 = "INSERT INTO \"$table\" (";
+ $sql2 = "VALUES (" . Database::makeList( $a );
+ $first = true;
+ foreach ( $a as $field => $value ) {
+ if ( !$first ) {
+ $sql1 .= ",";
+ }
+ $first = false;
+ $sql1 .= $field;
+ }
+ $sql = "$sql1) $sql2)";
+ return !!$this->query( $sql, $fname );
+ }
+
+ # A cross between insertArray and getArray, takes a condition array and a SET array
+ function updateArray( $table, $values, $conds, $fname = "Database::updateArray" )
+ {
+ $sql = "UPDATE '$table' SET " . $this->makeList( $values, LIST_SET );
+ $sql .= " WHERE " . $this->makeList( $conds, LIST_AND );
+ $this->query( $sql, $fname );
+ }
+
+ # Makes a wfStrencoded list from an array
+ # $mode: LIST_COMMA - comma separated, no field names
+ # LIST_AND - ANDed WHERE clause (without the WHERE)
+ # LIST_SET - comma separated with field names, like a SET clause
+ /* static */ function makeList( $a, $mode = LIST_COMMA )
+ {
+ $first = true;
+ $list = "";
+ foreach ( $a as $field => $value ) {
+ if ( !$first ) {
+ if ( $mode == LIST_AND ) {
+ $list .= " AND ";
+ } else {
+ $list .= ",";
+ }
+ } else {
+ $first = false;
+ }
+ if ( $mode == LIST_AND || $mode == LIST_SET ) {
+ $list .= "$field=";
+ }
+ if ( !is_numeric( $value ) ) {
+ $list .= "'" . wfStrencode( $value ) . "'";
+ } else {
+ $list .= $value;
+ }
+ }
+ return $list;
+ }
+
+ function startTimer( $timeout )
+ {
+ global $IP;
+ wfDebugDieBacktrace( "Database::startTimer() error : mysql_thread_id() not implemented for postgre" );
+ $tid = mysql_thread_id( $this->mConn );
+ exec( "php $IP/killthread.php $timeout $tid &>/dev/null &" );
+ }
+
+ function stopTimer()
+ {
+ }
+
+}
+
+#------------------------------------------------------------------------------
+# Global functions
+#------------------------------------------------------------------------------
+
+/* Standard fail function, called by default when a connection cannot be established
+ Displays the file cache if possible */
+function wfEmergencyAbort( &$conn ) {
+ global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgSiteNotice, $wgOutputEncoding;
+
+ header( "Content-type: text/html; charset=$wgOutputEncoding" );
+ $msg = $wgSiteNotice;
+ if($msg == "") $msg = wfMsgNoDB( "noconnect" );
+ $text = $msg;
+
+ if($wgUseFileCache) {
+ if($wgTitle) {
+ $t =& $wgTitle;
+ } else {
+ if($title) {
+ $t = Title::newFromURL( $title );
+ } elseif (@$_REQUEST['search']) {
+ $search = $_REQUEST['search'];
+ echo wfMsgNoDB( "searchdisabled" );
+ echo wfMsgNoDB( "googlesearch", htmlspecialchars( $search ), $wgInputEncoding );
+ wfAbruptExit();
+ } else {
+ $t = Title::newFromText( wfMsgNoDB( "mainpage" ) );
+ }
+ }
+
+ $cache = new CacheManager( $t );
+ if( $cache->isFileCached() ) {
+ $msg = "<p style='color: red'><b>$msg<br />\n" .
+ wfMsgNoDB( "cachederror" ) . "</b></p>\n";
+
+ $tag = "<div id='article'>";
+ $text = str_replace(
+ $tag,
+ $tag . $msg,
+ $cache->fetchPageText() );
+ }
+ }
+
+ /* Don't cache error pages! They cause no end of trouble... */
+ header( "Cache-control: none" );
+ header( "Pragma: nocache" );
+ echo $text;
+ wfAbruptExit();
+}
+
+function wfStrencode( $s )
+{
+ return pg_escape_string( $s );
+}
+
+# Use PostgreSQL timestamp without timezone data type
+function wfTimestamp2Unix( $ts ) {
+ return gmmktime( ( (int)substr( $ts, 11, 2) ),
+ (int)substr( $ts, 14, 2 ), (int)substr( $ts, 17, 2 ),
+ (int)substr( $ts, 5, 2 ), (int)substr( $ts, 8, 2 ),
+ (int)substr( $ts, 0, 4 ) );
+}
+
+function wfUnix2Timestamp( $unixtime ) {
+ return gmdate( "Y-m-d H:i:s", $unixtime );
+}
+
+function wfTimestampNow() {
+ # return NOW
+ return gmdate( "Y-m-d H:i:s" );
+}
+
+# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
+function wfInvertTimestamp( $ts ) {
+ $ts=preg_replace("/\D/","",$ts);
+ return strtr(
+ $ts,
+ "0123456789",
+ "9876543210"
+ );
+}
+
+function wfLimitResult( $limit, $offset ) {
+ return " LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
+}
+
+?>
diff --git a/languages/LanguageLatin1.php b/languages/LanguageLatin1.php
new file mode 100644
index 000000000000..a03de9111aec
--- /dev/null
+++ b/languages/LanguageLatin1.php
@@ -0,0 +1,252 @@
+<?php
+# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
+# http://www.mediawiki.org/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# http://www.gnu.org/copyleft/gpl.html
+
+#
+# Latin-1 compatibility layer hack.
+#
+# Enable by setting "$wgUseLatin1 = true;" in LocalSettings.php
+# (Preferably at install time so you get the messages right!)
+#
+# This will replace anything that can't be described in Latin-1 with
+# an ugly question mark (?) so don't use this mode on languages that
+# aren't suited to it!
+#
+
+$wgInputEncoding = "iso-8859-1";
+$wgOutputEncoding = "iso-8859-1";
+
+function utf8_decode_array( $arr ) {
+ if( !is_array( $arr ) ) {
+ wfDebugDieBacktrace( "utf8_decode_array given non-array" );
+ }
+ return array_map( "utf8_decode", $arr );
+}
+
+#
+# This is a proxy object; the Language instance handed to us speaks
+# UTF-8, while the wiki outside speaks Latin-1. We translate as
+# necessary so neither knows the other is in the wrong charset.
+#
+class LanguageLatin1 {
+ var $lang;
+
+ function LanguageLatin1( &$language ) {
+ $this->lang =& $language;
+ }
+
+ function getDefaultUserOptions() {
+ return $this->lang->getDefaultUserOptions();
+ }
+
+ function getBookstoreList() {
+ return utf8_decode_array( $this->lang->getBookstoreList() );
+ }
+
+ function getNamespaces() {
+ return utf8_decode_array( $this->lang->getNamespaces() );
+ }
+
+ function getNsText( $index ) {
+ return utf8_decode( $this->lang->getNsText( $index ) );
+ }
+
+ function getNsIndex( $text ) {
+ return $this->lang->getNsIndex( utf8_encode( $text ) );
+ }
+
+ function specialPage( $name ) {
+ # At least one function calls this with Special:Undelete/Article_title, so it needs encoding
+ return utf8_decode( $this->lang->specialPage( utf8_encode( $name ) ) );
+ }
+
+ function getQuickbarSettings() {
+ return utf8_decode_array( $this->lang->getQuickbarSettings() );
+ }
+
+ function getSkinNames() {
+ return utf8_decode_array( $this->lang->getSkinNames() );
+ }
+
+ function getMathNames() {
+ return utf8_decode_array( $this->lang->getMathNames() );
+ }
+
+ function getDateFormats() {
+ return utf8_decode_array( $this->lang->getDateFormats() );
+ }
+
+ function getUserToggles() {
+ return utf8_decode_array( $this->lang->getUserToggles() );
+ }
+
+ function getUserToggle( $tog ) {
+ return utf8_decode( $this->lang->getUserToggle( $tog ) );
+ }
+
+ function getLanguageNames() {
+ return utf8_decode_array( $this->lang->getLanguageNames() );
+ }
+
+ function getLanguageName( $code ) {
+ return utf8_decode( $this->lang->getLanguageName( $code ) );
+ }
+
+ function getMonthName( $key ) {
+ return utf8_decode( $this->lang->getMonthName( $key ) );
+ }
+
+ function getMonthNameGen( $key ) {
+ return utf8_decode( $this->lang->getMonthNameGen( $key ) );
+ }
+
+ function getMonthAbbreviation( $key ) {
+ return utf8_decode( $this->lang->getMonthAbbreviation( $key ) );
+ }
+
+ function getWeekdayName( $key ) {
+ return utf8_decode( $this->lang->getWeekdayName( $key ) );
+ }
+
+ function userAdjust( $ts ) {
+ return $this->lang->userAdjust( $ts );
+ }
+
+ function date( $ts, $adj = false ) {
+ return utf8_decode( $this->lang->date( $ts, $adj ) );
+ }
+
+ function time( $ts, $adj = false, $seconds = false ) {
+ return utf8_decode( $this->lang->time( $ts, $adj ) );
+ }
+
+ function timeanddate( $ts, $adj = false ) {
+ return utf8_decode( $this->lang->timeanddate( $ts, $adj ) );
+ }
+
+ function rfc1123( $ts ) {
+ # ASCII by definition
+ return $this->lang->rfc1123( $ts );
+ }
+
+ function getValidSpecialPages() {
+ return utf8_decode_array( $this->lang->getValidSpecialPages() );
+ }
+
+ function getSysopSpecialPages() {
+ return utf8_decode_array( $this->lang->getSysopSpecialPages() );
+ }
+
+ function getDeveloperSpecialPages() {
+ return utf8_decode_array( $this->lang->getDeveloperSpecialPages() );
+ }
+
+ function getMessage( $key ) {
+ return utf8_decode( $this->lang->getMessage( $key ) );
+ }
+
+ function getAllMessages() {
+ return utf8_decode_array( $this->lang->getAllMessages() );
+ }
+
+ function iconv( $in, $out, $string ) {
+ # Use 8-bit version
+ return Language::iconv( $in, $out, $string );
+ }
+
+ function ucfirst( $string ) {
+ # Use 8-bit version
+ return Language::ucfirst( $string );
+ }
+
+ function lcfirst( $s ) {
+ # Use 8-bit version
+ return Language::lcfirst( $s );
+ }
+
+ function checkTitleEncoding( $s ) {
+ # Use 8-bit version
+ return Language::checkTitleEncoding( $s );
+ }
+
+ function stripForSearch( $in ) {
+ # Use 8-bit version
+ return Language::stripForSearch( $in );
+ }
+
+ function firstChar( $s ) {
+ # Use 8-bit version
+ return Language::firstChar( $s );
+ }
+
+ function setAltEncoding() {
+ # Not sure if this should be handled
+ $this->lang->setAltEncoding();
+ }
+
+ function recodeForEdit( $s ) {
+ # Use 8-bit version
+ return Language::recodeForEdit( $s );
+ }
+
+ function recodeInput( $s ) {
+ # Use 8-bit version
+ return Language::recodeInput( $s );
+ }
+
+ function isRTL() {
+ # boolean
+ return $this->lang->isRTL();
+ }
+
+ function linkPrefixExtension() {
+ # boolean
+ return $this->lang->linkPrefixExtension();
+ }
+
+ function &getMagicWords() {
+ return utf8_decode_array( $this->lang->getMagicWords() );
+ }
+
+ function getMagic( &$mw ) {
+ # Not sure how to handle this.
+ # A moot point perhaps as few language files currently
+ # assign localised magic words, and none of the ones we
+ # need backwards compatibility for.
+ return $this->lang->getMagic( $mw );
+ }
+
+ function emphasize( $text ) {
+ # It's unlikely that the emphasis markup itself will
+ # include any non-ASCII chars.
+ return $this->lang->emphasize( $text );
+ }
+
+ function formatNum( $number ) {
+ # Probably not necessary...
+ return utf8_decode( $this->lang->formatNum( $number ) );
+ }
+
+ function listToText( $l ) {
+ # It's unlikely that the list markup itself will
+ # include any non-ASCII chars. (?)
+ return $this->lang->listToText( $l );
+ }
+}
+
+?>
diff --git a/languages/Names.php b/languages/Names.php
new file mode 100644
index 000000000000..9dacdbaacf7c
--- /dev/null
+++ b/languages/Names.php
@@ -0,0 +1,204 @@
+<?php
+/* private */ $wgLanguageNames = array(
+ 'aa' => 'Afar', # Afar
+ 'ab' => 'Abkhazian', # Abkhazian - FIXME
+ 'af' => 'Afrikaans', # Afrikaans
+ 'ak' => 'Akana', # Akan
+ 'an' => 'Aragon&eacute;s', # Aragonese
+ 'als' => 'Els&auml;ssisch', # Alsatian
+ 'am' => '&#4768;&#4635;&#4653;&#4763;', # Amharic
+ 'ar' => '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;', # Arabic
+ 'arc' => '&#1813;&#1829;&#1810;&#1834;&#1848;&#1821;&#1819;', # Aramaic
+ 'as' => '&#2437;&#2488;&#2478;&#2496;&#2527;&#2494;', # Assamese
+ 'ast' => 'Asturleon&eacute;s', # Asturian
+ 'av' => '&#1040;&#1074;&#1072;&#1088;', # Avar
+ 'ay' => 'Aymar', # Aymara
+ 'az' => 'Az&#601;rbaycan', # Azerbaijani
+ 'ba' => '&#1041;&#1072;&#1096;&#1185;&#1086;&#1088;&#1090;', # Bashkir
+ 'be' => '&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103;', # Belarusian ''or'' Byelarussian
+ 'bg' => '&#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;', # Bulgarian
+ 'bh' => '&#2349;&#2379;&#2332;&#2346;&#2369;&#2352;&#2368;', # Bihara
+ 'bi' => 'Bislama', # Bislama
+ 'bn' => '&#2476;&#2494;&#2434;&#2482;&#2494; - (Bangla)', # Bengali
+ 'bm' => 'Bambara',
+ 'bo' => 'Bod skad', # Tibetan
+ 'br' => 'Brezhoneg', # Breton
+ 'bs' => 'Bosanski', # Bosnian
+ 'ca' => 'Catal&agrave;', # Catalan
+ 'ce' => '&#1053;&#1086;&#1093;&#1095;&#1080;&#1081;&#1085;', # Chechen
+ 'ch' => 'Chamoru', # Chamorro
+ 'chr' => '&#5091;&#5043;&#5033;', # Cherokee
+ 'chy' => 'Tsets&ecirc;hest&acirc;hese', # Cheyenne
+ 'co' => 'Corsu', # Corsican
+ 'cr' => 'Nehiyaw', # Cree
+ 'cs' => '&#268;esky', # Czech
+ 'csb' => 'Kasz&euml;bscziej', # Cassubian - FIXME
+ 'cv' => '&#1063;&#1233;&#1074;&#1072;&#1096; - (&#264;&#259;va&#349;)', # Chuvash
+ 'cy' => 'Cymraeg', # Welsh
+ 'da' => 'Dansk', # Danish
+ 'de' => 'Deutsch', # German
+ 'dk' => 'Dansk', # 'da' is correct for the language.
+ 'dv' => 'Dhivehi', # Dhivehi
+ 'dz' => 'Dzongkha', # Bhutani
+ 'ee' => 'Eve', # Eve
+ 'el' => '&#917;&#955;&#955;&#951;&#957;&#953;&#954;&#940;', # Greek
+ 'en' => 'English', # English
+ 'eo' => 'Esperanto', # Esperanto
+ 'es' => 'Espa&ntilde;ol', # Spanish
+ 'et' => 'Eesti', # Estonian
+ 'eu' => 'Euskara', # Basque
+ 'fa' => '&#1601;&#1575;&#1585;&#1587;&#1740;', # Persian
+ 'ff' => 'Fulfulde', # Fulfulde
+ 'fi' => 'Suomi', # Finnish
+ 'fj' => 'Na Vosa Vakaviti', # Fijian
+ 'fo' => 'F&oslash;royskt', # Faroese
+ 'fr' => 'Fran&ccedil;ais', # French
+ 'fy' => 'Frysk', # Frisian
+ 'ga' => 'Gaeilge', # Irish
+ 'gd' => 'G&agrave;idhlig', # Scots Gaelic
+ 'gl' => 'Galego', # Gallegan
+ 'gn' => 'Ava&ntilde;e\'&#7869;', # Guarani
+ 'gu' => '&#2711;&#2753;&#2716;&#2736;&#2750;&#2724;&#2752;', # Gujarati
+ 'gv' => 'Gaelg', # Manx
+ 'ha' => '&#1607;&#1614;&#1608;&#1615;&#1587;&#1614;', # Hausa
+ 'haw' => 'Hawai`i', # Hawaiian
+ 'he' => '&#1506;&#1489;&#1512;&#1497;&#1514;', # Hebrew
+ 'hi' => '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;', # Hindi
+ 'ho' => 'Hiri Motu',
+ 'hr' => 'Hrvatski', # Croatian
+ 'ht' => 'Haitian', # Haitian (FIXME!)
+ 'hu' => 'Magyar', # Hungarian
+ 'hy' => '&#1344;&#1377;&#1397;&#1381;&#1408;&#1381;&#1398;', # Armenian
+ 'hz' => 'Otsiherero', # Herero
+ 'ia' => 'Interlingua', # Interlingua (IALA)
+ 'id' => 'Bahasa Indonesia', # Indonesian
+ 'ie' => 'Interlingue', # Interlingue (Occidental)
+ 'ig' => 'Igbo', # Igbo
+ 'ii' => 'Yi', # Sichuan Yi (FIXME!)
+ 'ik' => 'I&ntilde;upiak', # Inupiak
+ 'io' => 'Ido', # Ido
+ 'is' => '&Iacute;slensk', # Icelandic
+ 'it' => 'Italiano', # Italian
+ 'iu' => '&#5123;&#5316;&#5251;&#5198;&#5200;&#5222;', # Inuktitut
+ 'ja' => '&#26085;&#26412;&#35486;', # Japanese
+ 'jv' => 'Bahasa Jawa', # Javanese
+ 'ka' => '&#4325;&#4304;&#4320;&#4311;&#4323;&#4314;&#4312;', # Georgian
+ 'kg' => 'Kongo', # Kongo (FIXME!)
+ 'ki' => 'Kikuyu', # Kikuyu (FIXME!)
+ 'kj' => 'Kuanyama', # Kuanyama (FIXME!)
+ 'kk' => '&#1179;&#1072;&#1079;&#1072;&#1179;&#1096;&#1072;', # Kazakh
+ 'kl' => 'Kalaallisut', # Greenlandic
+ 'km' => '&#6039;&#6070;&#6047;&#6070;&#6017;&#6098;&#6040;&#6082;&#6042;', # Cambodian
+ 'kn' => '&#3221;&#3240;&#3277;&#3240;&#3233;', # Kannada
+ 'ko' => '&#54620;&#44397;&#50612;', # Korean
+ 'kr' => 'Kanuri',
+ 'ks' => '&#2325;&#2358;&#2381;&#2350;&#2368;&#2352;&#2368; - (&#1603;&#1588;&#1605;&#1610;&#1585;&#1610;)', # Kashmiri
+ 'ku' => 'Kurd&icirc;', # Kurdish
+ 'kv' => 'Komi',
+ 'kw' => 'Kernewek', # Cornish
+ 'ky' => 'K&#305;rg&#305;zca', # Kirghiz
+ 'la' => 'Latina', # Latin
+ 'lb' => 'L&euml;tzebuergesch', # Luxemburguish
+ 'lg' => 'Luganda', # Ganda
+ 'li' => 'Limburgs', # Limburgian
+ 'ln' => 'Lingala', # Lingala
+ 'lo' => 'Pha xa lao', # Laotian
+ 'lt' => 'Lietuvi&#371;', # Lithuanian
+ 'lv' => 'Latvie&scaron;u', # Latvian
+ 'mg' => 'Malagasy', # Malagasy - FIXME
+ 'mh' => 'Ebon', # Marshallese
+ 'mi' => 'M&#257;ori', # Maori
+ 'mk' => '&#1052;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;', # Macedonian
+ 'ml' => '&#3374;&#3378;&#3375;&#3390;&#3379;&#3330;', # Malayalam
+ 'mn' => '&#1052;&#1086;&#1085;&#1075;&#1086;&#1083;', # Mongoloian
+ 'mo' => 'Moldoveana', # Moldovan
+ 'mr' => '&#2350;&#2352;&#2366;&#2336;&#2368;', # Marathi
+ 'ms' => 'Bahasa Melayu', # Malay
+ 'mt' => 'bil-Malti', # Maltese
+ 'my' => 'Myanmasa', # Burmese
+ 'na' => 'Nauru', # Nauruan
+ 'nb' => 'Bokm&aring;l', # Norwegian (Bokmal)
+ 'nah' => 'Nahuatl',
+ 'nds' => 'Platd&uuml;&uuml;tsch', # Low German ''or'' Low Saxon
+ 'ne' => '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;', # Nepali
+ 'ng' => 'Ndonga',
+ 'nl' => 'Nederlands', # Dutch
+ 'nb' => 'Norsk', # Norwegian [currently using old '''no''' code]
+ 'ne' => '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;', # Nepali
+ 'nn' => 'Nynorsk' , # (Norwegian) Nynorsk
+ 'no' => 'Norsk', # Norwegian
+ 'nv' => 'Din&eacute; bizaad', # Navajo
+ 'ny' => 'Chi-Chewa', # Chichewa
+ 'oc' => 'Occitan', # Occitan
+ 'om' => 'Oromoo', # Oromo
+ 'or' => 'Oriya', # Oriya - FIXME
+ 'pa' => '&#2346;&#2306;&#2332;&#2366;&#2348;&#2368; / &#2602;&#2588;&#2622;&#2604;&#2624; / &#1662;&#1606;&#1580;&#1575;&#1576;&#1610;', # Punjabi
+ 'pi' => '&#2346;&#2366;&#2367;&#2356;', # Pali
+ 'pl' => 'Polski', # Polish
+ 'ps' => '&#1662;&#1690;&#1578;&#1608;', # Pashto
+ 'pt' => 'Portugu&ecirc;s', # Portuguese
+ 'qu' => 'Runa Simi', # Quechua
+ 'rm' => 'Rumantsch', # Raeto-Romance
+ 'rn' => 'Kirundi', # Kirundi
+ 'ro' => 'Rom&acirc;n&#259;', # Romanian
+ 'roa-rup' => 'Arm&#226;neashti', # Aromanian
+ 'ru' => '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;', # Russian
+ 'rw' => 'Kinyarwanda',
+ 'sa' => '&#2360;&#2306;&#2360;&#2381;&#2325;&#2371;&#2340;', # Sanskrit
+ 'sc' => 'Sardu', # Sardinian
+ 'sd' => '&#2360;&#2367;&#2344;&#2343;&#2367;', # Sindhi
+ 'se' => 'S&aacute;megiella', # (Northern) Sami
+ 'sg' => 'Sangro',
+# 'sh' => '&#1057;&#1088;&#1087;&#1089;&#1082;&#1086;&#1093;&#1088;&#1074;&#1072;&#1090;&#1089;&#1082;&#1080; (Srbskohrvatski)', ## Serbocroatian -- Obsolete
+ 'si' => 'Simhala', # Sinhalese
+ 'simple' => 'Simple English',
+ 'sk' => 'Sloven&#269;ina', # Slovak
+ 'sl' => 'Sloven&scaron;&#269;ina', # Slovenian
+ 'sm' => 'Gagana Samoa', # Samoan
+ 'sn' => 'chiShona', # Shona
+ 'so' => 'Soomaaliga', # Somali
+ 'sq' => 'Shqip', # Albanian
+ 'sr' => '&#1057;&#1088;&#1087;&#1089;&#1082;&#1080; / Srpski', # Serbian
+ 'ss' => 'SiSwati', # Swati
+ 'st' => 'seSotho', # (Southern) Sotho
+ 'su' => 'Bahasa Sunda', # Sundanese
+ 'sv' => 'Svenska', # Swedish
+ 'sw' => 'Kiswahili', # Swahili
+ 'ta' => '&#2980;&#2990;&#3007;&#2996;&#3021;', # Tamil
+ 'te' => '&#3108;&#3142;&#3122;&#3137;&#3095;&#3137;', # Telugu
+ 'tg' => '&#1058;&#1086;&#1207;&#1080;&#1082;&#1251;', # Tajik
+ 'th' => '&#3652;&#3607;&#3618;', # Thai
+ 'ti' => 'Tigrinya', # Tigrinya - FIXME
+ 'tk' => '&#1578;&#1585;&#1603;&#1605;&#1606; / &#1058;&#1091;&#1088;&#1082;&#1084;&#1077;&#1085;', # Turkmen
+ 'tl' => 'Tagalog', # Tagalog (Filipino)
+ #'tlh' => 'tlhIngan-Hol', # Klingon - no interlanguage links allowed
+ 'tn' => 'Setswana', # Setswana
+ 'to' => 'Tonga', # Tonga - FIXME
+ 'tokipona' => 'Toki Pona', # Toki Pona
+ 'tp' => 'Toki Pona', # Toki Pona - non-standard language code
+ 'tpi' => 'Tok Pisin', # Tok Pisin
+ 'tr' => 'T&uuml;rk&ccedil;e', # Turkish
+ 'ts' => 'Xitsonga', # Tsonga
+ 'tt' => 'Tatar', # Tatar
+ 'tw' => 'Twi', # Twi -- FIXME
+ 'ty' => 'Reo M&#257;`ohi', # Tahitian
+ 'ug' => 'Oyghurque', # Uyghur
+ 'uk' => '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;', # Ukrainian
+ 'ur' => '&#1575;&#1585;&#1583;&#1608;', # Urdu
+ 'uz' => '&#1038;&#1079;&#1073;&#1077;&#1082;', # Uzbek
+ 've' => 'Venda', # Venda
+ 'vi' => 'Ti&#7871;ng Vi&#7879;t', # Vietnamese
+ 'vo' => 'Volap&uuml;k', # Volapük
+ 'wa' => 'Walon', # Walloon
+ 'wo' => 'Wollof', # Wolof
+ 'xh' => 'isiXhosa', # Xhosan
+ 'yi' => '&#1497;&#1497;&#1460;&#1491;&#1497;&#1513;', # Yiddish
+ 'yo' => 'Yor&ugrave;b&aacute;', # Yoruba
+ 'za' => '(Cuengh)', # Zhuang
+ 'zh' => '&#20013;&#25991;', # (Zh&#333;ng Wén) - Chinese
+ 'zh-cfr' => '&#38313;&#21335;&#35486;', # Min-nan
+ 'zh-cn' => '&#20013;&#25991;(&#31616;&#20307;)', # Simplified
+ 'zh-tw' => '&#20013;&#25991;(&#32321;&#20307;)', # Traditional
+ 'zu' => 'isiZulu', # Zulu
+);
+?>
diff --git a/maintenance/postgresql/pg_tables.sql b/maintenance/postgresql/pg_tables.sql
new file mode 100644
index 000000000000..b8265fb5914b
--- /dev/null
+++ b/maintenance/postgresql/pg_tables.sql
@@ -0,0 +1,587 @@
+--
+-- Totally untested postgresql dump for the table "tables".
+--
+--
+--
+
+--
+-- PostgreSQL database dump
+--
+
+SET client_encoding = 'UNICODE';
+SET check_function_bodies = false;
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 4 (OID 2200)
+-- Name: public; Type: ACL; Schema: -; Owner: postgres
+--
+
+REVOKE ALL ON SCHEMA public FROM PUBLIC;
+GRANT ALL ON SCHEMA public TO PUBLIC;
+
+-- FIXME ! Either remove line or use the mediawiki database user there
+SET SESSION AUTHORIZATION 'hashar';
+
+SET search_path = public, pg_catalog;
+
+--
+-- TOC entry 5 (OID 17145)
+-- Name: user_user_id_seq; Type: SEQUENCE; Schema: public; Owner: hashar
+--
+
+CREATE SEQUENCE user_user_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+--
+-- TOC entry 9 (OID 17147)
+-- Name: user; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE "user" (
+ user_id integer DEFAULT nextval('user_user_id_seq'::text),
+ user_name character varying(255) DEFAULT ''::character varying NOT NULL,
+ user_real_name character varying(255) DEFAULT ''::character varying NOT NULL,
+ user_rights text DEFAULT ''::text NOT NULL,
+ user_password text DEFAULT ''::text NOT NULL,
+ user_newpassword text DEFAULT ''::text NOT NULL,
+ user_email text DEFAULT ''::text NOT NULL,
+ user_options text DEFAULT ''::text NOT NULL,
+ user_touched character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 10 (OID 17161)
+-- Name: user_newtalk; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE user_newtalk (
+ user_id integer DEFAULT 0 NOT NULL,
+ user_ip character varying(40) DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- TOC entry 6 (OID 17167)
+-- Name: cur_cur_id_seq; Type: SEQUENCE; Schema: public; Owner: hashar
+--
+
+CREATE SEQUENCE cur_cur_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+--
+-- TOC entry 11 (OID 17169)
+-- Name: cur; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE cur (
+ cur_id integer DEFAULT nextval('cur_cur_id_seq'::text),
+ cur_namespace smallint DEFAULT 0::smallint NOT NULL,
+ cur_title character varying(255) DEFAULT ''::character varying NOT NULL,
+ cur_text text DEFAULT ''::text NOT NULL,
+ cur_comment text DEFAULT ''::text NOT NULL,
+ cur_user integer DEFAULT 0 NOT NULL,
+ cur_user_text character varying(255) DEFAULT ''::character varying NOT NULL,
+ cur_timestamp character(14) DEFAULT ''::bpchar NOT NULL,
+ cur_restrictions text DEFAULT ''::text NOT NULL,
+ cur_counter bigint DEFAULT 0::bigint NOT NULL,
+ cur_is_redirect smallint DEFAULT 0::smallint NOT NULL,
+ cur_minor_edit smallint DEFAULT 0::smallint NOT NULL,
+ cur_is_new smallint DEFAULT 0::smallint NOT NULL,
+ cur_random double precision NOT NULL,
+ cur_touched character(14) DEFAULT ''::bpchar NOT NULL,
+ inverse_timestamp character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 7 (OID 17191)
+-- Name: old_old_id_seq; Type: SEQUENCE; Schema: public; Owner: hashar
+--
+
+CREATE SEQUENCE old_old_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+--
+-- TOC entry 12 (OID 17193)
+-- Name: old; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE "old" (
+ old_id integer DEFAULT nextval('old_old_id_seq'::text),
+ old_namespace smallint DEFAULT 0::smallint NOT NULL,
+ old_title character varying(255) DEFAULT ''::character varying NOT NULL,
+ old_text text DEFAULT ''::text NOT NULL,
+ old_comment text DEFAULT ''::text NOT NULL,
+ old_user integer DEFAULT 0 NOT NULL,
+ old_user_text character varying(255) NOT NULL,
+ old_timestamp character(14) DEFAULT ''::bpchar NOT NULL,
+ old_minor_edit smallint DEFAULT 0::smallint NOT NULL,
+ old_flags text DEFAULT ''::text NOT NULL,
+ inverse_timestamp character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 13 (OID 17208)
+-- Name: archive; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE archive (
+ ar_namespace smallint DEFAULT 0::smallint NOT NULL,
+ ar_title character varying(255) DEFAULT ''::character varying NOT NULL,
+ ar_text text DEFAULT ''::text NOT NULL,
+ ar_comment text DEFAULT ''::text NOT NULL,
+ ar_user integer DEFAULT 0 NOT NULL,
+ ar_user_text character varying(255) NOT NULL,
+ ar_timestamp character(14) DEFAULT ''::bpchar NOT NULL,
+ ar_minor_edit smallint DEFAULT 0::smallint NOT NULL,
+ ar_flags text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- TOC entry 14 (OID 17221)
+-- Name: links; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE links (
+ l_from integer DEFAULT 0 NOT NULL,
+ l_to integer DEFAULT 0 NOT NULL
+);
+
+
+--
+-- TOC entry 15 (OID 17227)
+-- Name: brokenlinks; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE brokenlinks (
+ bl_from integer DEFAULT 0 NOT NULL,
+ bl_to character varying(255) DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- TOC entry 16 (OID 17233)
+-- Name: imagelinks; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE imagelinks (
+ il_from integer DEFAULT 0 NOT NULL,
+ il_to character varying(255) DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- TOC entry 17 (OID 17239)
+-- Name: categorylinks; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE categorylinks (
+ cl_from integer DEFAULT 0 NOT NULL,
+ cl_to character varying(255) DEFAULT ''::character varying NOT NULL,
+ cl_sortkey character varying(255) DEFAULT ''::character varying NOT NULL,
+ cl_timestamp timestamp without time zone NOT NULL
+);
+
+
+--
+-- TOC entry 18 (OID 17244)
+-- Name: linkscc; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE linkscc (
+ lcc_pageid integer NOT NULL,
+ lcc_cacheobj text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- TOC entry 19 (OID 17252)
+-- Name: site_stats; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE site_stats (
+ ss_row_id integer NOT NULL,
+ ss_total_views bigint DEFAULT 0::bigint,
+ ss_total_edits bigint DEFAULT 0::bigint,
+ ss_good_articles bigint DEFAULT 0::bigint
+);
+
+
+--
+-- TOC entry 20 (OID 17257)
+-- Name: hitcounter; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE hitcounter (
+ hc_id integer NOT NULL
+);
+
+
+--
+-- TOC entry 8 (OID 17259)
+-- Name: ipblocks_ipb_id_seq; Type: SEQUENCE; Schema: public; Owner: hashar
+--
+
+CREATE SEQUENCE ipblocks_ipb_id_seq
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+--
+-- TOC entry 21 (OID 17261)
+-- Name: ipblocks; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE ipblocks (
+ ipb_id integer DEFAULT nextval('ipblocks_ipb_id_seq'::text),
+ ipb_address character varying(40) DEFAULT ''::character varying NOT NULL,
+ ipb_user integer DEFAULT 0 NOT NULL,
+ ipb_by integer DEFAULT 0 NOT NULL,
+ ipb_reason text DEFAULT ''::text NOT NULL,
+ ipb_timestamp character(14) DEFAULT ''::bpchar NOT NULL,
+ ipb_auto smallint DEFAULT 0::smallint NOT NULL,
+ ipb_expiry character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 22 (OID 17274)
+-- Name: image; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE image (
+ img_name character varying(255) DEFAULT ''::character varying NOT NULL,
+ img_size integer DEFAULT 0 NOT NULL,
+ img_description text DEFAULT ''::text NOT NULL,
+ img_user integer DEFAULT 0 NOT NULL,
+ img_user_text character varying(255) DEFAULT ''::character varying NOT NULL,
+ img_timestamp character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 23 (OID 17285)
+-- Name: oldimage; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE oldimage (
+ oi_name character varying(255) DEFAULT ''::character varying NOT NULL,
+ oi_archive_name character varying(255) DEFAULT ''::character varying NOT NULL,
+ oi_size integer DEFAULT 0 NOT NULL,
+ oi_description text DEFAULT ''::text NOT NULL,
+ oi_user integer DEFAULT 0 NOT NULL,
+ oi_user_text character varying(255) DEFAULT ''::character varying NOT NULL,
+ oi_timestamp character(14) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 24 (OID 17297)
+-- Name: recentchanges; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE recentchanges (
+ rc_timestamp character varying(14) DEFAULT ''::character varying NOT NULL,
+ rc_cur_time character varying(14) DEFAULT ''::character varying NOT NULL,
+ rc_user integer DEFAULT 0 NOT NULL,
+ rc_user_text character varying(255) DEFAULT ''::character varying NOT NULL,
+ rc_namespace smallint DEFAULT 0::smallint NOT NULL,
+ rc_title character varying(255) DEFAULT ''::character varying NOT NULL,
+ rc_comment character varying(255) DEFAULT ''::character varying NOT NULL,
+ rc_minor smallint DEFAULT 0::smallint NOT NULL,
+ rc_bot smallint DEFAULT 0::smallint NOT NULL,
+ rc_new smallint DEFAULT 0::smallint NOT NULL,
+ rc_cur_id integer DEFAULT 0 NOT NULL,
+ rc_this_oldid integer DEFAULT 0 NOT NULL,
+ rc_last_oldid integer DEFAULT 0 NOT NULL,
+ rc_type smallint DEFAULT 0::smallint NOT NULL,
+ rc_moved_to_ns smallint DEFAULT 0::smallint NOT NULL,
+ rc_moved_to_title character varying(255) DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- TOC entry 25 (OID 17318)
+-- Name: watchlist; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE watchlist (
+ wl_user integer NOT NULL,
+ wl_namespace smallint DEFAULT 0::smallint NOT NULL,
+ wl_title character varying(255) DEFAULT ''::character varying NOT NULL
+);
+
+
+--
+-- TOC entry 26 (OID 17322)
+-- Name: math; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE math (
+ math_inputhash character varying(16) NOT NULL,
+ math_outputhash character varying(16) NOT NULL,
+ math_html_conservativeness smallint NOT NULL,
+ math_html text,
+ math_mathml text
+);
+
+
+--
+-- TOC entry 27 (OID 17327)
+-- Name: searchindex; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE searchindex (
+ si_page integer NOT NULL,
+ si_title character varying(255) DEFAULT ''::character varying NOT NULL,
+ si_text text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- TOC entry 28 (OID 17334)
+-- Name: interwiki; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE interwiki (
+ iw_prefix character(32) NOT NULL,
+ iw_url character(127) NOT NULL,
+ iw_local boolean NOT NULL
+);
+
+
+--
+-- TOC entry 29 (OID 17336)
+-- Name: querycache; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE querycache (
+ qc_type character(32) NOT NULL,
+ qc_value integer DEFAULT 0 NOT NULL,
+ qc_namespace smallint DEFAULT 0::smallint NOT NULL,
+ qc_title character(255) DEFAULT ''::bpchar NOT NULL
+);
+
+
+--
+-- TOC entry 30 (OID 17343)
+-- Name: objectcache; Type: TABLE; Schema: public; Owner: hashar
+--
+
+CREATE TABLE objectcache (
+ keyname character(255) DEFAULT ''::bpchar NOT NULL,
+ value text,
+ exptime timestamp without time zone NOT NULL
+);
+
+
+--
+-- TOC entry 47 (OID 17351)
+-- Name: math_inputhash_math_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX math_inputhash_math_index ON math USING btree (math_inputhash);
+
+
+--
+-- TOC entry 49 (OID 17352)
+-- Name: iw_prefix_interwiki_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX iw_prefix_interwiki_index ON interwiki USING btree (iw_prefix);
+
+
+--
+-- TOC entry 44 (OID 17353)
+-- Name: ss_row_id_site_stats_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX ss_row_id_site_stats_index ON site_stats USING btree (ss_row_id);
+
+
+--
+-- TOC entry 33 (OID 17354)
+-- Name: old_id_old_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX old_id_old_index ON "old" USING btree (old_id);
+
+
+--
+-- TOC entry 36 (OID 17355)
+-- Name: bl_from_brokenlinks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX bl_from_brokenlinks_index ON brokenlinks USING btree (bl_from, bl_to);
+
+
+--
+-- TOC entry 45 (OID 17356)
+-- Name: ipb_id_ipblocks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX ipb_id_ipblocks_index ON ipblocks USING btree (ipb_id);
+
+
+--
+-- TOC entry 32 (OID 17357)
+-- Name: cur_id_cur_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX cur_id_cur_index ON cur USING btree (cur_id);
+
+
+--
+-- TOC entry 38 (OID 17358)
+-- Name: il_from_imagelinks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX il_from_imagelinks_index ON imagelinks USING btree (il_from, il_to);
+
+
+--
+-- TOC entry 31 (OID 17359)
+-- Name: user_id_user_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX user_id_user_index ON "user" USING btree (user_id);
+
+
+--
+-- TOC entry 48 (OID 17360)
+-- Name: key_searchindex_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX key_searchindex_index ON searchindex USING btree (si_page);
+
+
+--
+-- TOC entry 51 (OID 17361)
+-- Name: key_objectcache_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX key_objectcache_index ON objectcache USING btree (keyname);
+
+
+--
+-- TOC entry 46 (OID 17362)
+-- Name: key_watchlist_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX key_watchlist_index ON watchlist USING btree (wl_user, wl_namespace, wl_title);
+
+
+--
+-- TOC entry 34 (OID 17363)
+-- Name: l_from_links_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX l_from_links_index ON links USING btree (l_from, l_to);
+
+
+--
+-- TOC entry 40 (OID 17364)
+-- Name: cl_from_categorylinks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE UNIQUE INDEX cl_from_categorylinks_index ON categorylinks USING btree (cl_from, cl_to);
+
+
+--
+-- TOC entry 41 (OID 17365)
+-- Name: cl_sortkey_categorylinks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE INDEX cl_sortkey_categorylinks_index ON categorylinks USING btree (cl_to, cl_sortkey);
+
+
+--
+-- TOC entry 42 (OID 17366)
+-- Name: cl_timestamp_categorylinks_index; Type: INDEX; Schema: public; Owner: hashar
+--
+
+CREATE INDEX cl_timestamp_categorylinks_index ON categorylinks USING btree (cl_to, cl_timestamp);
+
+
+--
+-- TOC entry 35 (OID 17225)
+-- Name: links_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY links
+ ADD CONSTRAINT links_pkey PRIMARY KEY (l_from, l_to);
+
+
+--
+-- TOC entry 37 (OID 17231)
+-- Name: brokenlinks_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY brokenlinks
+ ADD CONSTRAINT brokenlinks_pkey PRIMARY KEY (bl_to);
+
+
+--
+-- TOC entry 39 (OID 17237)
+-- Name: imagelinks_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY imagelinks
+ ADD CONSTRAINT imagelinks_pkey PRIMARY KEY (il_to);
+
+
+--
+-- TOC entry 43 (OID 17250)
+-- Name: linkscc_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY linkscc
+ ADD CONSTRAINT linkscc_pkey PRIMARY KEY (lcc_pageid);
+
+
+--
+-- TOC entry 50 (OID 17341)
+-- Name: querycache_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY querycache
+ ADD CONSTRAINT querycache_pkey PRIMARY KEY (qc_type, qc_value);
+
+
+--
+-- TOC entry 52 (OID 17349)
+-- Name: objectcache_pkey; Type: CONSTRAINT; Schema: public; Owner: hashar
+--
+
+ALTER TABLE ONLY objectcache
+ ADD CONSTRAINT objectcache_pkey PRIMARY KEY (exptime);
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 3 (OID 2200)
+-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
+--
+
+COMMENT ON SCHEMA public IS 'Standard public schema';
+
diff --git a/stylesheets/myskin/main.css b/stylesheets/myskin/main.css
new file mode 100644
index 000000000000..f3ab020480a6
--- /dev/null
+++ b/stylesheets/myskin/main.css
@@ -0,0 +1 @@
+/* this file must be empty */