r5951 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5950‎ | r5951 | r5952 >
Date:18:08, 17 October 2004
Author:jeluf
Status:old
Tags:
Comment:
Make various special pages work, spelling fixes
Modified paths:
  • /branches/SCHEMA_WORK/phase3/includes/Article.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/LinksUpdate.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/SpecialBrokenRedirects.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/SpecialDeadendpages.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/SpecialDisambiguations.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/SpecialDoubleRedirects.php (modified) (history)
  • /branches/SCHEMA_WORK/phase3/includes/SpecialMaintenance.php (modified) (history)

Diff [purge]

Index: branches/SCHEMA_WORK/phase3/includes/Article.php
@@ -508,17 +508,16 @@
509509 }
510510
511511 /**
512 - * Loads everything from cur except cur_text
 512+ * Loads everything except the text
513513 * This isn't necessary for all uses, so it's only done if needed.
514514 * @private
515515 */
516516 function loadLastEdit() {
517 - ## $this->loadContent();
518 - ## return;
519517 global $wgOut;
520 - ## wfDebugDieBacktrace( "Shouldn't the content do this?" );
521 - if ( -1 != $this->mUser ) return;
522518
 519+ if ( -1 != $this->mUser )
 520+ return;
 521+
523522 $fname = 'Article::loadLastEdit';
524523
525524 $dbr =& $this->getDB();
Index: branches/SCHEMA_WORK/phase3/includes/SpecialDisambiguations.php
@@ -33,18 +33,18 @@
3434
3535 function getSQL() {
3636 $dbr =& wfGetDB( DB_SLAVE );
37 - extract( $dbr->tableNames( 'cur', 'links' ) );
 37+ extract( $dbr->tableNames( 'page', 'links' ) );
3838
3939 $dp = Title::newFromText(wfMsgForContent("disambiguationspage"));
4040 $dpid = $dp->getArticleID();
4141
42 - $sql = "SELECT ca.cur_namespace AS ns_art, ca.cur_title AS title_art,"
43 - . " cb.cur_namespace AS ns_dis, cb.cur_title AS title_dis"
44 - . " FROM links as la, links as lb, cur as ca, cur as cb"
 42+ $sql = "SELECT pa.page_namespace AS ns_art, pa.page_title AS title_art,"
 43+ . " pb.page_namespace AS ns_dis, pb.page_title AS title_dis"
 44+ . " FROM {$links} as la, {$links} as lb, {$page} as pa, {$page} as pb"
4545 . " WHERE la.l_to = '{$dpid}'"
4646 . " AND la.l_from = lb.l_to"
47 - . " AND ca.cur_id = lb.l_from"
48 - . " AND cb.cur_id = lb.l_to";
 47+ . " AND pa.page_id = lb.l_from"
 48+ . " AND pb.page_id = lb.l_to";
4949
5050 return $sql;
5151 }
Index: branches/SCHEMA_WORK/phase3/includes/SpecialBrokenRedirects.php
@@ -30,10 +30,10 @@
3131
3232 function getSQL() {
3333 $dbr =& wfGetDB( DB_SLAVE );
34 - extract( $dbr->tableNames( 'cur', 'brokenlinks' ) );
 34+ extract( $dbr->tableNames( 'page', 'brokenlinks' ) );
3535
36 - $sql = "SELECT bl_to,cur_title FROM $brokenlinks,$cur " .
37 - "WHERE cur_is_redirect=1 AND cur_namespace=0 AND bl_from=cur_id ";
 36+ $sql = "SELECT bl_to,page_title FROM $brokenlinks,$page " .
 37+ "WHERE page_is_redirect=1 AND page_namespace=0 AND bl_from=page_id ";
3838 return $sql;
3939 }
4040
@@ -45,8 +45,8 @@
4646 global $wgContLang ;
4747
4848 $ns = $wgContLang->getNamespaces() ; /* not used, why bother? */
49 - $from = $skin->makeKnownLink( $result->cur_title ,'', 'redirect=no' );
50 - $edit = $skin->makeBrokenLink( $result->cur_title , "(".wfMsg("qbedit").")" , 'redirect=no');
 49+ $from = $skin->makeKnownLink( $result->page_title ,'', 'redirect=no' );
 50+ $edit = $skin->makeBrokenLink( $result->page_title , "(".wfMsg("qbedit").")" , 'redirect=no');
5151 $to = $skin->makeBrokenLink( $result->bl_to );
5252
5353 return "$from $edit => $to";
Index: branches/SCHEMA_WORK/phase3/includes/SpecialDeadendpages.php
@@ -42,12 +42,12 @@
4343 */
4444 function getSQL() {
4545 $dbr =& wfGetDB( DB_SLAVE );
46 - extract( $dbr->tableNames( 'cur', 'links' ) );
47 - return "SELECT 'Deadendpages' as type, cur_namespace AS namespace, cur_title as title, cur_title AS value " .
48 - "FROM $cur LEFT JOIN $links ON cur_id = l_from " .
 46+ extract( $dbr->tableNames( 'page', 'links' ) );
 47+ return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " .
 48+ "FROM $page LEFT JOIN $links ON page_id = l_from " .
4949 "WHERE l_from IS NULL " .
50 - "AND cur_namespace = 0 " .
51 - "AND cur_is_redirect = 0";
 50+ "AND page_namespace = 0 " .
 51+ "AND page_is_redirect = 0";
5252 }
5353 }
5454
Index: branches/SCHEMA_WORK/phase3/includes/SpecialDoubleRedirects.php
@@ -30,14 +30,15 @@
3131
3232 function getSQL() {
3333 $dbr =& wfGetDB( DB_SLAVE );
34 - extract( $dbr->tableNames( 'cur', 'links' ) );
 34+ extract( $dbr->tableNames( 'page', 'links', 'text' ) );
3535
36 - $sql = "SELECT ca.cur_namespace as ns_a, ca.cur_title as title_a," .
37 - " cb.cur_namespace as ns_b, cb.cur_title as title_b," .
38 - " cb.cur_text AS rt " .
39 - "FROM $links,$cur AS ca,$cur AS cb ".
40 - "WHERE ca.cur_is_redirect=1 AND cb.cur_is_redirect=1 AND l_to=cb.cur_id " .
41 - " AND l_from=ca.cur_id " ;
 36+ $sql = "SELECT pa.page_namespace as ns_a, pa.page_title as title_a,
 37+ pb.page_namespace as ns_b, pb.page_title as title_b,
 38+ old_text AS rt
 39+ FROM $text AS t, $links,$page AS pa,$page AS pb
 40+ WHERE pa.page_is_redirect=1 AND pb.page_is_redirect=1 AND l_to=pb.page_id
 41+ AND l_from=pa.page_id
 42+ AND pb.page_latest=t.old_id" ;
4243 return $sql;
4344 }
4445
Index: branches/SCHEMA_WORK/phase3/includes/LinksUpdate.php
@@ -272,7 +272,7 @@
273273 $fname = 'LinksUpdate::fixBrokenLinks';
274274
275275 $dbw =& wfGetDB( DB_MASTER );
276 - $cur = $dbw->tableName( 'page' );
 276+ $page = $dbw->tableName( 'page' );
277277 $links = $dbw->tableName( 'links' );
278278
279279 $res = $dbw->select( 'brokenlinks', array( 'bl_from' ), array( 'bl_to' => $this->mTitle ),
Index: branches/SCHEMA_WORK/phase3/includes/SpecialMaintenance.php
@@ -157,8 +157,8 @@
158158
159159 list( $limit, $offset ) = wfCheckLimits();
160160
161 - $sql = "SELECT cur_namespace,cur_title FROM cur,links " .
162 - "WHERE l_from=l_to AND l_to=cur_id " .
 161+ $sql = "SELECT page_namespace,page_title FROM page,links " .
 162+ "WHERE l_from=l_to AND l_to=page_id " .
163163 "LIMIT {$offset}, {$limit}";
164164
165165 $res = wfQuery( $sql, DB_SLAVE, $fname );
@@ -175,7 +175,7 @@
176176 $sk = $wgUser->getSkin();
177177 $s = '<ol start=' . ( $offset + 1 ) . '>';
178178 while ( $obj = wfFetchObject( $res ) ) {
179 - $title = Title::makeTitle( $obj->cur_namespace, $obj->cur_title );
 179+ $title = Title::makeTitle( $obj->page_namespace, $obj->page_title );
180180 $s .= "<li>".$sk->makeKnownLinkObj( $title )."</li>\n" ;
181181 }
182182 wfFreeResult( $res );

Follow-up revisions

RevisionCommit summaryAuthorDate
r47229applying r5951 from wikia codebase: don't use deprecated isBot() methodashley21:03, 13 February 2009

Status & tagging log