Extension:MediaWikiLite.php

From Organic Design wiki
Revision as of 04:03, 30 December 2007 by Nad (talk | contribs) (make a start)

<?php

  1. Extension:SQLite
Info.svg These are the MediaWiki extensions we're using and/or developing. Please refer to the information on the mediawiki.org wiki for installation and usage details. Extensions here which have no corresponding mediawiki article are either not ready for use or have been superseded. You can also browse our extension code in our local Subversion repository or our GitHub mirror.

Template:PhpCategory:Extensions in progress

  1. - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
  2. - Author: User:NadCategory:Extensions created with Template:Extension

if (!defined('MEDIAWIKI')) die('Not an entry point.');

define('SQLITE_VERSION','0.0.0, 2007-12-17');

$wgDBtype = 'sqlite';

$wgExtensionCredits['other'][] = array( 'name' => 'SQLite', 'author' => 'User:Nad', 'description' => 'Allow MediaWiki installations to store content in an SQLite database instead of MySQL', 'url' => 'http://www.organicdesign.co.nz/Extension:SQLite.php', 'version' => SQLITE_VERSION );

class DatabaseSqlite extends Database {

function DatabaseSqlite($server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0) { global $wgOut; # Can't get a reference if it hasn't been set yet if (!isset($wgOut)) $wgOut = NULL; $this->mOut =& $wgOut; $this->mFailFunction = $failFunction; $this->mFlags = $flags; $this->open($server, $user, $password, $dbName); }

function cascadingDeletes() { return true; } function cleanupTriggers() { return true; } function strictIPs() { return true; } function realTimestamps() { return true; } function implicitGroupby() { return false; } function implicitOrderby() { return false; } function searchableIPs() { return true; } function functionalIndexes() { return true; }

static function newFromParams($server, $user, $password, $dbName, $failFunction = false, $flags = 0) { return new DatabaseSqlite($server, $user, $password, $dbName, $failFunction, $flags); }

/** * Usually aborts on failure * If the failFunction is set to a non-zero integer, returns success */ function open( $server, $user, $password, $dbName ) { }

}