From 7a31146918cdceef14689bf05d8f1602ec05bfcb Mon Sep 17 00:00:00 2001 From: "coadde [Márcio Alexandre Silva Delgado]" Date: Mon, 4 Jul 2016 16:01:35 -0300 Subject: remove nonfree Database support --- includes/installer/MssqlUpdater.php | 143 ------------------------------------ 1 file changed, 143 deletions(-) delete mode 100644 includes/installer/MssqlUpdater.php (limited to 'includes/installer/MssqlUpdater.php') diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php deleted file mode 100644 index 164cfab4..00000000 --- a/includes/installer/MssqlUpdater.php +++ /dev/null @@ -1,143 +0,0 @@ -_ckc - * - * @param string $constraintType - * @param string $table Name of the table to which the field belongs - * @param string $field Name of the field to modify - * @return bool False if patch is skipped. - */ - protected function updateConstraints( $constraintType, $table, $field ) { - global $wgDBname, $wgDBmwschema; - - if ( !$this->doTable( $table ) ) { - return true; - } - - $this->output( "...updating constraints on [$table].[$field] ..." ); - $updateKey = "$field-$constraintType-ck"; - if ( !$this->db->tableExists( $table, __METHOD__ ) ) { - $this->output( "...$table table does not exist, skipping modify field patch.\n" ); - return true; - } elseif ( !$this->db->fieldExists( $table, $field, __METHOD__ ) ) { - $this->output( "...$field field does not exist in $table table, " . - "skipping modify field patch.\n" ); - return true; - } elseif ( $this->updateRowExists( $updateKey ) ) { - $this->output( "...$field in table $table already patched.\n" ); - return true; - } - - # After all checks passed, start the update - $this->insertUpdateRow( $updateKey ); - $path = 'named_constraints.sql'; - $constraintMap = array( - 'category_types' => - "($field in('page', 'subcat', 'file'))", - 'major_mime' => - "($field in('unknown', 'application', 'audio', 'image', 'text', 'video'," . - " 'message', 'model', 'multipart'))", - 'media_type' => - "($field in('UNKNOWN', 'BITMAP', 'DRAWING', 'AUDIO', 'VIDEO', 'MULTIMEDIA'," . - "'OFFICE', 'TEXT', 'EXECUTABLE', 'ARCHIVE'))" - ); - $constraint = $constraintMap[$constraintType]; - - # and hack-in those variables that should be replaced - # in our template file right now - $this->db->setSchemaVars( array( - 'tableName' => $table, - 'fieldName' => $field, - 'checkConstraint' => $constraint, - 'wgDBname' => $wgDBname, - 'wgDBmwschema' => $wgDBmwschema, - ) ); - - # Full path from file name - $path = $this->db->patchPath( $path ); - - # No need for a cursor allowing result-iteration; just apply a patch - # store old value for re-setting later - $wasScrollable = $this->db->scrollableCursor( false ); - - # Apply patch - $this->db->sourceFile( $path ); - - # Reset DB instance to have original state - $this->db->setSchemaVars( false ); - $this->db->scrollableCursor( $wasScrollable ); - - $this->output( "done.\n" ); - - return true; - } -} -- cgit v1.2.3-54-g00ecf