X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FMssqlUpdater.php;h=bdaf4c815defca5d5db23392ed3475fcdaf07c39;hb=09208169f3f8bb28b76f96ff7439d81c713d6adf;hp=5eef335532e363d5d12036c15b1be9c26b97cc1f;hpb=b7ec2c9b3353b99fe30e1e202c8625cac2f541f3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index 5eef335532..bdaf4c815d 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -36,35 +36,40 @@ class MssqlUpdater extends DatabaseUpdater { protected $db; protected function getCoreUpdateList() { - return array( + return [ // 1.23 - array( 'addField', 'mwuser', 'user_password_expires', 'patch-user_password_expires.sql' ), + [ 'addField', 'mwuser', 'user_password_expires', 'patch-user_password_expires.sql' ], // 1.24 - array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql'), + [ 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql' ], // 1.25 - array( 'dropTable', 'hitcounter' ), - array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), - array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), + [ 'dropTable', 'hitcounter' ], + [ 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ], + [ 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ], // Constraint updates - array( 'updateConstraints', 'category_types', 'categorylinks', 'cl_type' ), - array( 'updateConstraints', 'major_mime', 'filearchive', 'fa_major_mime' ), - array( 'updateConstraints', 'media_type', 'filearchive', 'fa_media_type' ), - array( 'updateConstraints', 'major_mime', 'oldimage', 'oi_major_mime' ), - array( 'updateConstraints', 'media_type', 'oldimage', 'oi_media_type' ), - array( 'updateConstraints', 'major_mime', 'image', 'img_major_mime' ), - array( 'updateConstraints', 'media_type', 'image', 'img_media_type' ), - array( 'updateConstraints', 'media_type', 'uploadstash', 'us_media_type' ), + [ 'updateConstraints', 'category_types', 'categorylinks', 'cl_type' ], + [ 'updateConstraints', 'major_mime', 'filearchive', 'fa_major_mime' ], + [ 'updateConstraints', 'media_type', 'filearchive', 'fa_media_type' ], + [ 'updateConstraints', 'major_mime', 'oldimage', 'oi_major_mime' ], + [ 'updateConstraints', 'media_type', 'oldimage', 'oi_media_type' ], + [ 'updateConstraints', 'major_mime', 'image', 'img_major_mime' ], + [ 'updateConstraints', 'media_type', 'image', 'img_media_type' ], + [ 'updateConstraints', 'media_type', 'uploadstash', 'us_media_type' ], // END: Constraint updates - array( 'modifyField', 'image', 'img_major_mime', - 'patch-img_major_mime-chemical.sql' ), - array( 'modifyField', 'oldimage', 'oi_major_mime', - 'patch-oi_major_mime-chemical.sql' ), - array( 'modifyField', 'filearchive', 'fa_major_mime', - 'patch-fa_major_mime-chemical.sql' ), - ); + [ 'modifyField', 'image', 'img_major_mime', + 'patch-img_major_mime-chemical.sql' ], + [ 'modifyField', 'oldimage', 'oi_major_mime', + 'patch-oi_major_mime-chemical.sql' ], + [ 'modifyField', 'filearchive', 'fa_major_mime', + 'patch-fa_major_mime-chemical.sql' ], + + // 1.27 + [ 'dropTable', 'msg_resource_links' ], + [ 'dropTable', 'msg_resource' ], + [ 'addField', 'watchlist', 'wl_id', 'patch-watchlist-wl_id.sql' ], + ]; } /** @@ -100,7 +105,7 @@ class MssqlUpdater extends DatabaseUpdater { # After all checks passed, start the update $this->insertUpdateRow( $updateKey ); $path = 'named_constraints.sql'; - $constraintMap = array( + $constraintMap = [ 'category_types' => "($field in('page', 'subcat', 'file'))", 'major_mime' => @@ -109,18 +114,18 @@ class MssqlUpdater extends DatabaseUpdater { '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( + $this->db->setSchemaVars( [ 'tableName' => $table, 'fieldName' => $field, 'checkConstraint' => $constraint, 'wgDBname' => $wgDBname, 'wgDBmwschema' => $wgDBmwschema, - ) ); + ] ); # Full path from file name $path = $this->db->patchPath( $path );