r24448 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24447‎ | r24448 | r24449 >
Date:01:56, 30 July 2007
Author:river
Status:old
Tags:
Comment:
- new field: page_key, stores page_title in uppercase.
schema change, maintenance script included
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -82,6 +82,7 @@
8383 array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql'),
8484 array( 'archive', 'ar_page', 'patch-archive-ar_page.sql'),
8585 array( 'image', 'img_sha1', 'patch-img_sha1.sql' ),
 86+ array( 'page', 'page_key', 'patch-page_key.sql' ),
8687 );
8788
8889 # For extensions only, should be populated via hooks
Index: trunk/phase3/maintenance/tables.sql
@@ -190,6 +190,9 @@
191191 -- Spaces are transformed into underscores in title storage.
192192 page_title varchar(255) binary NOT NULL,
193193
 194+ -- page_title in uppercase. Used for case-insensitive title searching.
 195+ page_key varchar(255) binary NOT NULL,
 196+
194197 -- Comma-separated set of permission keys indicating who
195198 -- can move or edit the page.
196199 page_restrictions tinyblob NOT NULL,
Index: trunk/phase3/includes/Article.php
@@ -262,6 +262,7 @@
263263 'page_id',
264264 'page_namespace',
265265 'page_title',
 266+ 'page_key',
266267 'page_restrictions',
267268 'page_counter',
268269 'page_is_redirect',
@@ -1001,6 +1002,7 @@
10021003 * @private
10031004 */
10041005 function insertOn( $dbw ) {
 1006+ global $wgContLang;
10051007 wfProfileIn( __METHOD__ );
10061008
10071009 $page_id = $dbw->nextSequenceValue( 'page_page_id_seq' );
@@ -1008,6 +1010,7 @@
10091011 'page_id' => $page_id,
10101012 'page_namespace' => $this->mTitle->getNamespace(),
10111013 'page_title' => $this->mTitle->getDBkey(),
 1014+ 'page_key' => $wgContLang->caseFold($this->mTitle->getDBkey()),
10121015 'page_counter' => 0,
10131016 'page_restrictions' => '',
10141017 'page_is_redirect' => 0, # Will set this shortly...
Index: trunk/phase3/includes/Title.php
@@ -2126,7 +2126,7 @@
21272127 * be a redirect
21282128 */
21292129 private function moveOverExistingRedirect( &$nt, $reason = '' ) {
2130 - global $wgUseSquid;
 2130+ global $wgUseSquid, $wgContLang;
21312131 $fname = 'Title::moveOverExistingRedirect';
21322132 $comment = wfMsgForContent( '1movedto2_redir', $this->getPrefixedText(), $nt->getPrefixedText() );
21332133
@@ -2156,6 +2156,7 @@
21572157 'page_touched' => $dbw->timestamp($now),
21582158 'page_namespace' => $nt->getNamespace(),
21592159 'page_title' => $nt->getDBkey(),
 2160+ 'page_key' => $wgContLang->caseFold($nt->getDBkey()),
21602161 'page_latest' => $nullRevId,
21612162 ),
21622163 /* WHERE */ array( 'page_id' => $oldid ),
@@ -2203,7 +2204,7 @@
22042205 * @param Title &$nt the new Title
22052206 */
22062207 private function moveToNewTitle( &$nt, $reason = '' ) {
2207 - global $wgUseSquid;
 2208+ global $wgUseSquid, $wgContLang;
22082209 $fname = 'MovePageForm::moveToNewTitle';
22092210 $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
22102211 if ( $reason ) {
@@ -2226,6 +2227,7 @@
22272228 'page_touched' => $now,
22282229 'page_namespace' => $nt->getNamespace(),
22292230 'page_title' => $nt->getDBkey(),
 2231+ 'page_key' => $wgContLang->caseFold($nt->getDBkey()),
22302232 'page_latest' => $nullRevId,
22312233 ),
22322234 /* WHERE */ array( 'page_id' => $oldid ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r24502Merged revisions 24415-24479 via svnmerge from...david22:31, 31 July 2007

Status & tagging log