r31838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31837‎ | r31838 | r31839 >
Date:23:38, 11 March 2008
Author:brion
Status:old
Tags:
Comment:
Don't use generic function names in your extension, you may confict
Modified paths:
  • /trunk/extensions/DidYouMean/DidYouMean.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DidYouMean/DidYouMean.php
@@ -203,7 +203,7 @@
204204 if ($article->getTitle()->getNamespace() != 0 || $article->isRedirect() == true)
205205 return true;
206206
207 - wfDoInsert( $article->getID(), $article->getTitle()->getText() );
 207+ wfDymDoInsert( $article->getID(), $article->getTitle()->getText() );
208208
209209 return true;
210210 }
@@ -229,7 +229,7 @@
230230 if ($article->getTitle()->getNamespace() != 0 || $article->isRedirect() == true)
231231 return true;
232232
233 - wfDoDelete( $article->getID() );
 233+ wfDymDoDelete( $article->getID() );
234234
235235 return true;
236236 }
@@ -257,11 +257,11 @@
258258 #}
259259
260260 if ($oldns == 0 && $newns == 0) {
261 - wfDoUpdate( $pageid, $newtitletext );
 261+ wfDymDoUpdate( $pageid, $newtitletext );
262262 } elseif ($oldns == 0) {
263 - wfDoDelete( $pageid );
 263+ wfDymDoDelete( $pageid );
264264 } elseif ($newns == 0) {
265 - wfDoInsert( $pageid, $newtitletext );
 265+ wfDymDoInsert( $pageid, $newtitletext );
266266 }
267267
268268 return true;
@@ -288,10 +288,10 @@
289289
290290 if ($article->isRedirect($text)) {
291291 if (!$wgParser->mDymRedirBeforeEdit && !($flags & EDIT_NEW))
292 - wfDoDelete( $article->getID() );
 292+ wfDymDoDelete( $article->getID() );
293293 } else {
294294 if ($wgParser->mDymRedirBeforeEdit || $flags & EDIT_NEW)
295 - wfDoInsert( $article->getID(), $article->getTitle()->getText() );
 295+ wfDymDoInsert( $article->getID(), $article->getTitle()->getText() );
296296 }
297297
298298 $wgParser->mDymRedirBeforeEdit = false;
@@ -299,7 +299,7 @@
300300 return true;
301301 }
302302
303 -function wfDoInsert( $pageid , $title ) {
 303+function wfDymDoInsert( $pageid , $title ) {
304304 wfDebug( 'HIPP: ' . __METHOD__ . " INSERT\n" );
305305 $dbw = wfGetDB( DB_MASTER );
306306
@@ -318,12 +318,12 @@
319319 $dbw->insert( 'dympage', array( 'dp_pageid' => $pageid, 'dp_normid' => $normid ) );
320320
321321 # touch all pages which will now link here
322 - wfTouchPages( "dp_normid=$normid" );
 322+ wfDymTouchPages( "dp_normid=$normid" );
323323
324324 }
325325
326326
327 -function wfTouchPages( $condition ) {
 327+function wfDymTouchPages( $condition ) {
328328 global $wgDBtype;
329329
330330 $dbw = wfGetDB( DB_MASTER );
@@ -341,7 +341,7 @@
342342
343343 }
344344
345 -function wfDoDelete( $pageid ) {
 345+function wfDymDoDelete( $pageid ) {
346346 wfDebug( 'HIPP: ' . __METHOD__ . " DELETE\n" );
347347 $dbw = wfGetDB( DB_MASTER );
348348
@@ -355,10 +355,10 @@
356356 $dbw->delete( 'dymnorm', array('dn_normid' => $normid) );
357357
358358 # touch all pages which will now link here
359 - wfTouchPages( "dp_normid=$normid" );
 359+ wfDymTouchPages( "dp_normid=$normid" );
360360 }
361361
362 -function wfDoUpdate( $pageid, $title ) {
 362+function wfDymDoUpdate( $pageid, $title ) {
363363 wfDebug( 'HIPP: ' . __METHOD__ . " MOVE\n" );
364364 $dbw = wfGetDB( DB_MASTER );
365365
@@ -385,7 +385,7 @@
386386 $dbw->delete( 'dymnorm', array('dn_normid' => $oldnormid) );
387387
388388 # touch all pages which linked to the old name or will link to the new one
389 - wfTouchPages( "(dp_normid=$normid OR dp_normid=$oldnormid)" );
 389+ wfDymTouchPages( "(dp_normid=$normid OR dp_normid=$oldnormid)" );
390390
391391 }
392392 }

Status & tagging log