X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FMssqlUpdater.php;h=bdaf4c815defca5d5db23392ed3475fcdaf07c39;hb=e3bd13db0c285f312e31bb1b7271af4628cca80c;hp=770f493aa64a09c8548e406153ec7ac83a69d5ac;hpb=640892e0fd6e4acc0407f84d81dc7bf9b651592f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index 770f493aa6..bdaf4c815d 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -36,39 +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 - array( 'dropTable', 'msg_resource_links' ), - array( 'dropTable', 'msg_resource' ), - ); + [ 'dropTable', 'msg_resource_links' ], + [ 'dropTable', 'msg_resource' ], + [ 'addField', 'watchlist', 'wl_id', 'patch-watchlist-wl_id.sql' ], + ]; } /** @@ -104,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' => @@ -113,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 );