Difference between revisions of "Extension:MediaWikiLite.php"
m (cat) |
(make a start) |
||
Line 7: | Line 7: | ||
define('SQLITE_VERSION','0.0.0, 2007-12-17'); | define('SQLITE_VERSION','0.0.0, 2007-12-17'); | ||
+ | |||
+ | $wgDBtype = 'sqlite'; | ||
$wgExtensionCredits['other'][] = array( | $wgExtensionCredits['other'][] = array( | ||
Line 15: | Line 17: | ||
'version' => SQLITE_VERSION | '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 ) { | ||
+ | } | ||
+ | |||
+ | } |
Revision as of 04:03, 30 December 2007
<?php
- Extension:SQLite
Template:PhpCategory:Extensions in progress
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - 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 ) { }
}