r85163 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85162‎ | r85163 | r85164 >
Date:22:49, 1 April 2011
Author:reedy
Status:deferred
Tags:
Comment:
Create MSSQLBackCompat.php load point, hack up code to work on newer versions
Modified paths:
  • /trunk/extensions/MSSQLBackCompat/DatabaseMssqlOld.php (modified) (history)
  • /trunk/extensions/MSSQLBackCompat/MSSQLBackCompat.php (added) (history)

Diff [purge]

Index: trunk/extensions/MSSQLBackCompat/DatabaseMssqlOld.php
@@ -10,7 +10,7 @@
1111 /**
1212 * @ingroup Database
1313 */
14 -class DatabaseMssql extends DatabaseBase {
 14+class DatabaseMssqlOld extends DatabaseBase {
1515
1616 var $mAffectedRows;
1717 var $mLastResult;
@@ -523,7 +523,7 @@
524524 for( $i = 0; $i < $n; $i++ ) {
525525 $meta = mssql_fetch_field( $res->result, $i );
526526 if( $field == $meta->name ) {
527 - return new MSSQLField($meta);
 527+ return new MSSQLOldField($meta);
528528 }
529529 }
530530 return false;
@@ -952,17 +952,33 @@
953953 /**
954954 * @ingroup Database
955955 */
956 -class MSSQLField extends MySQLField {
 956+class MSSQLOldField implements Field {
957957
958958 function __construct() {
959959 }
960960
961961 static function fromText($db, $table, $field) {
962 - $n = new MSSQLField;
 962+ $n = new MSSQLOldField;
963963 $n->name = $field;
964964 $n->tablename = $table;
965965 return $n;
966966 }
967967
 968+ function name() {
 969+ return $this->name;
 970+ }
 971+
 972+ function tableName() {
 973+ return $this->tableName;
 974+ }
 975+
 976+ function isNullable() {
 977+ return true;
 978+ }
 979+
 980+ function type() {
 981+ return '';
 982+ }
 983+
968984 } // end DatabaseMssql class
969985
Index: trunk/extensions/MSSQLBackCompat/MSSQLBackCompat.php
@@ -0,0 +1,13 @@
 2+<?php
 3+
 4+$wgExtensionCredits['other'][] = array(
 5+ 'path' => __FILE__,
 6+ 'name' => 'MSSQLBackCompat',
 7+ 'url' => '',
 8+ 'author' => 'Sam Reed',
 9+ 'descriptionmsg' => 'codereview-desc',
 10+);
 11+
 12+$dir = dirname( __FILE__ ) . '/';
 13+$wgAutoloadClasses['DatabaseMssqlOld'] = $dir . 'DatabaseMssqlOld.php';
 14+$wgAutoloadClasses['MSSQLOldField'] = $dir . 'DatabaseMssqlOld.php';
\ No newline at end of file
Property changes on: trunk/extensions/MSSQLBackCompat/MSSQLBackCompat.php
___________________________________________________________________
Added: svn:eol-style
115 + native

Status & tagging log