r93136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93135‎ | r93136 | r93137 >
Date:22:09, 25 July 2011
Author:reedy
Status:ok
Tags:
Comment:
More wfMkdirParents() __METHOD__ additions
Modified paths:
  • /trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php (modified) (history)
  • /trunk/extensions/DumpHTML/dumpHTML.inc (modified) (history)
  • /trunk/extensions/EditMessages/EditMessages_body.php (modified) (history)
  • /trunk/extensions/FlvHandler/FlvImageHandler.php (modified) (history)
  • /trunk/extensions/FundraiserPortal/rebuildButtons.php (modified) (history)
  • /trunk/extensions/LiquidThreads/i18n/Lqt.namespaces.php (modified) (history)
  • /trunk/extensions/Math/Math.body.php (modified) (history)
  • /trunk/extensions/OAI/OAIHarvest.php (modified) (history)
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)
  • /trunk/extensions/PdfHandler/PdfHandler_body.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TimedMediaThumbnail.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Simple.php (modified) (history)
  • /trunk/extensions/Translate/ffs/WikiExtension.php (modified) (history)
  • /trunk/extensions/Translate/scripts/magic-export.php (modified) (history)
  • /trunk/extensions/TrustedMath/TrustedMath_body.php (modified) (history)
  • /trunk/extensions/WebStore/WebStoreCommon.php (modified) (history)
  • /trunk/extensions/WebStore/inplace-scaler.php (modified) (history)
  • /trunk/extensions/WebStore/publish.php (modified) (history)
  • /trunk/extensions/WebStore/store.php (modified) (history)
  • /trunk/extensions/WikiAtHome/ApiWikiAtHome.php (modified) (history)
  • /trunk/extensions/WikiAtHome/NonFreeVideoHandler.php (modified) (history)
  • /trunk/extensions/WikiAtHome/internalCmdLineEncoder.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/i18n/Lqt.namespaces.php
@@ -18,10 +18,10 @@
1919 );
2020
2121 $namespaceNames['de'] = array(
22 - NS_LQT_THREAD => 'Thema',
23 - NS_LQT_THREAD_TALK => 'Thema_Diskussion',
24 - NS_LQT_SUMMARY => 'Themazusammenfassung',
25 - NS_LQT_SUMMARY_TALK => 'Themazusammenfassung_Diskussion',
 22+ NS_LQT_THREAD => 'Thema',
 23+ NS_LQT_THREAD_TALK => 'Thema_Diskussion',
 24+ NS_LQT_SUMMARY => 'Themazusammenfassung',
 25+ NS_LQT_SUMMARY_TALK => 'Themazusammenfassung_Diskussion',
2626 );
2727
2828 $namespaceNames['fi'] = array(
Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -262,7 +262,7 @@
263263 $thumbTime = $length / 2;
264264 }
265265
266 - wfMkdirParents( dirname( $dstPath ) );
 266+ wfMkdirParents( dirname( $dstPath ), null, __METHOD__ );
267267
268268 global $wgOggThumbLocation;
269269 if ( $wgOggThumbLocation !== false ) {
@@ -271,7 +271,7 @@
272272 $status = $this->runFFmpeg( $file->getPath(), $dstPath, $thumbTime );
273273 }
274274 if ( $status === true ) {
275 - return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height,
 275+ return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height,
276276 $length, $dstPath );
277277 } else {
278278 return new MediaTransformError( 'thumbnail_error', $width, $height, $status );
@@ -279,7 +279,7 @@
280280 }
281281
282282 /**
283 - * Run FFmpeg to generate a still image from a video file, using a frame close
 283+ * Run FFmpeg to generate a still image from a video file, using a frame close
284284 * to the given number of seconds from the start.
285285 *
286286 * Returns true on success, or an error message on failure.
@@ -287,10 +287,10 @@
288288 function runFFmpeg( $videoPath, $dstPath, $time ) {
289289 global $wgFFmpegLocation;
290290 wfDebug( __METHOD__." creating thumbnail at $dstPath\n" );
291 - $cmd = wfEscapeShellArg( $wgFFmpegLocation ) .
 291+ $cmd = wfEscapeShellArg( $wgFFmpegLocation ) .
292292 # FFmpeg only supports integer numbers of seconds
293293 ' -ss ' . intval( $time ) . ' ' .
294 - ' -i ' . wfEscapeShellArg( $videoPath ) .
 294+ ' -i ' . wfEscapeShellArg( $videoPath ) .
295295 # MJPEG, that's the same as JPEG except it's supported ffmpeg
296296 # No audio, one frame
297297 ' -f mjpeg -an -vframes 1 ' .
@@ -318,7 +318,7 @@
319319 }
320320
321321 /**
322 - * Run oggThumb to generate a still image from a video file, using a frame
 322+ * Run oggThumb to generate a still image from a video file, using a frame
323323 * close to the given number of seconds from the start.
324324 *
325325 * Returns true on success, or an error message on failure.
@@ -335,11 +335,11 @@
336336
337337 if ( $this->removeBadFile( $dstPath, $retval ) || $retval ) {
338338 // oggThumb spams both stderr and stdout with useless progress
339 - // messages, and then often forgets to output anything when
 339+ // messages, and then often forgets to output anything when
340340 // something actually does go wrong. So interpreting its output is
341341 // a challenge.
342342 $lines = explode( "\n", str_replace( "\r\n", "\n", $returnText ) );
343 - if ( count( $lines ) > 0
 343+ if ( count( $lines ) > 0
344344 && preg_match( '/invalid option -- \'n\'$/', $lines[0] ) )
345345 {
346346 return wfMsgForContent( 'ogg-oggThumb-version', '0.9' );
Index: trunk/extensions/FlvHandler/FlvImageHandler.php
@@ -40,7 +40,7 @@
4141 wfDebug( __METHOD__.": $cmd\n" );
4242 $out = wfShellExec( $cmd, $retval );
4343 wfProfileOut( 'rsvg' );
44 -
 44+
4545 if (preg_match($wgFLVProbes[$wgFLVConverter]['regex'], $out, $matches)) {
4646 return array($matches[1], $matches[2]); // width/height
4747 } else {
@@ -81,7 +81,7 @@
8282 return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath );
8383 }
8484
85 - if ( !wfMkdirParents( dirname( $dstPath ) ) ) {
 85+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
8686 return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight,
8787 wfMsg( 'thumbnail_dest_directory' ) );
8888 }
@@ -123,7 +123,7 @@
124124
125125 function getLongDesc( $file ) {
126126 global $wgLang;
127 -
 127+
128128 return wfMsgExt( 'flv-long-desc', 'parseinline',
129129 $wgLang->formatNum( $file->getWidth() ),
130130 $wgLang->formatNum( $file->getHeight() ),
Index: trunk/extensions/OAI/OAIHarvest.php
@@ -5,17 +5,17 @@
66 *
77 * Copyright (C) 2005-2006 Brion Vibber <brion@pobox.com>
88 * http://www.mediawiki.org/
9 - *
 9+ *
1010 * This program is free software; you can redistribute it and/or modify
1111 * it under the terms of the GNU General Public License as published by
12 - * the Free Software Foundation; either version 2 of the License, or
 12+ * the Free Software Foundation; either version 2 of the License, or
1313 * (at your option) any later version.
14 - *
 14+ *
1515 * This program is distributed in the hope that it will be useful,
1616 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1717 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1818 * GNU General Public License for more details.
19 - *
 19+ *
2020 * You should have received a copy of the GNU General Public License along
2121 * with this program; if not, write to the Free Software Foundation, Inc.,
2222 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -61,7 +61,7 @@
6262 function __construct( $baseURL ) {
6363 $this->_baseURL = $baseURL;
6464 }
65 -
 65+
6666 /**
6767 * Query the repository for updates, and run a callback for each item.
6868 * Will continue across resumption tokens until there's nothing left.
@@ -87,25 +87,25 @@
8888 'from' => oaiDatestamp( $from ) );
8989 }
9090 $xml = $this->callRepo( $params );
91 -
 91+
9292 $doc = new DOMDocument( '1.0', 'utf-8' );
9393 if( !$doc->loadXML( $xml ) )
9494 throw new OAIError( "Invalid XML returned from OAI repository." );
95 -
 95+
9696 $xp = new DOMXPath( $doc );
9797 $xp->registerNamespace( 'oai', 'http://www.openarchives.org/OAI/2.0/' );
9898 $errors = $this->checkResponseErrors( $xp );
9999 if( $errors ) {
100100 return $errors;
101101 }
102 -
 102+
103103 $resultSet = $xp->query( '/oai:OAI-PMH/oai:ListRecords/oai:record' );
104104 foreach( $resultSet as $node ) {
105105 $record = OAIUpdateRecord::newFromNode( $node );
106106 call_user_func( $callback, $record );
107107 unset( $record );
108108 }
109 -
 109+
110110 $tokenSet = $xp->query( '/oai:OAI-PMH/oai:ListRecords/oai:resumptionToken' );
111111 $token = ( $tokenSet->length )
112112 ? $tokenSet->item( 0 )->textContent
@@ -119,7 +119,7 @@
120120 } while( $token );
121121 return true;
122122 }
123 -
 123+
124124 /**
125125 * Check for OAI errors, and throw a formatted exception if present.
126126 *
@@ -130,17 +130,17 @@
131131 $errors = $xp->query( '/oai:OAI-PMH/oai:error' );
132132 if( !$errors )
133133 throw new OAIError( "Doesn't seem to be an OAI document...?" );
134 -
 134+
135135 if( $errors->length == 0 )
136136 return;
137 -
 137+
138138 $messages = array();
139139 for( $i = 0; $i < $errors->length; $i++ ) {
140140 $messages[$i] = $this->oaiErrorMessage( $errors->item( $i ) );
141141 }
142142 throw new OAIError( implode( "\n", $messages ) );
143143 }
144 -
 144+
145145 /**
146146 * Format a single OAI error response as a text message
147147 * @param DomNode $node
@@ -151,14 +151,14 @@
152152 $text = $node->textContent;
153153 return "$code: $text";
154154 }
155 -
 155+
156156 function throwOAIErrors( $errors ) {
157157 $message = array();
158158 foreach( $errors as $node ) {
159159 $message[] = $node->x;
160160 }
161161 }
162 -
 162+
163163 /**
164164 * Traverse a MediaWiki-format record set, sending an associative array
165165 * of data to a callback function.
@@ -172,11 +172,11 @@
173173 call_user_func( $callback, $data );
174174 }
175175 }
176 -
 176+
177177 function extractMediaWiki( $node ) {
178178 return array( 'everything' => 'testing' );
179179 }
180 -
 180+
181181 /**
182182 * Contact the HTTP repository with a given set of parameters,
183183 * and return the raw XML response data.
@@ -196,12 +196,12 @@
197197 throw new OAIError( "Repository returned HTTP result code $resultCode" );
198198 }
199199 }
200 -
 200+
201201 function requestURL( $params ) {
202202 $sep = (strpos( $this->_baseURL, '?' ) == false) ? '?' : '&';
203203 return $this->_baseURL . $sep . wfArrayToCGI( $params );
204204 }
205 -
 205+
206206 function userAgent() {
207207 global $oaiAgentExtra;
208208 $agent = 'MediaWiki OAI Harvester 0.2 (http://www.mediawiki.org/)';
@@ -210,7 +210,7 @@
211211 }
212212 return $agent;
213213 }
214 -
 214+
215215 /**
216216 * Fetch a resource from the web
217217 * @param string $url
@@ -222,12 +222,12 @@
223223 if( !ini_get( 'allow_url_fopen' ) ) {
224224 throw new OAIError( "Can't open URLs; must turn on allow_url_fopen" );
225225 }
226 -
 226+
227227 $uagent = ini_set( 'user_agent', $this->userAgent() );
228228 echo "Fetching: $url\n";
229229 $result = file_get_contents( $url );
230230 ini_set( 'user_agent', $uagent );
231 -
 231+
232232 # FIXME
233233 if( $result === false ) {
234234 $resultCode = 500;
@@ -236,7 +236,7 @@
237237 }
238238 return $result;
239239 }
240 -
 240+
241241 function fetchURLviaCURL( $url, &$resultCode ) {
242242 $fetch = curl_init( $url );
243243 if( defined( 'OAIDEBUG' ) ) {
@@ -245,12 +245,12 @@
246246 # CURLOPT_TIMEOUT
247247 # CURLOPT_REFERER?
248248 curl_setopt( $fetch, CURLOPT_USERAGENT, $this->userAgent() );
249 -
 249+
250250 ob_start();
251251 $ok = curl_exec( $fetch );
252252 $result = ob_get_contents();
253253 ob_end_clean();
254 -
 254+
255255 $info = curl_getinfo( $fetch );
256256 if( !$ok ) {
257257 echo "Something went awry...\n";
@@ -258,7 +258,7 @@
259259 die();
260260 }
261261 curl_close( $fetch );
262 -
 262+
263263 $resultCode = $info['http_code']; # ????
264264 return $result;
265265 }
@@ -266,23 +266,23 @@
267267
268268 class OAIUpdateRecord {
269269 var $_page = array();
270 -
 270+
271271 function __construct( $pageData ) {
272272 $this->_page = $pageData;
273273 }
274 -
 274+
275275 function getArticleId() {
276276 return IntVal( $this->_page['id'] );
277277 }
278 -
 278+
279279 function isDeleted() {
280280 return isset( $this->_page['deleted'] );
281281 }
282 -
 282+
283283 function getTitle() {
284284 return Title::newFromText( $this->_page['title'] );
285285 }
286 -
 286+
287287 function getTimestamp( $time ) {
288288 $matches = array();
289289 if( preg_match( '/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/', $time, $matches ) ) {
@@ -293,7 +293,7 @@
294294 return 0;
295295 }
296296 }
297 -
 297+
298298 function dump() {
299299 if( $this->isDeleted() ) {
300300 printf( "%14s %10d\n", '(deleted page)', $this->getArticleId() );
@@ -311,7 +311,7 @@
312312 }
313313 }
314314 }
315 -
 315+
316316 /**
317317 * Perform the action of this thingy
318318 * @throws OAIError
@@ -324,7 +324,7 @@
325325 }
326326 $this->checkpoint();
327327 }
328 -
 328+
329329 /**
330330 * Update our checkpoint timestamp with the date from the
331331 * OAI header; this allows us to pick up from the correct
@@ -334,7 +334,7 @@
335335 private function checkpoint() {
336336 global $oaiSourceRepository;
337337 $ts = $this->_page['oai_timestamp'];
338 -
 338+
339339 $dbw = wfGetDB( DB_MASTER );
340340 $dbw->replace( 'oaiharvest',
341341 array( 'oh_repository' ),
@@ -344,7 +344,7 @@
345345 ),
346346 __METHOD__ );
347347 }
348 -
 348+
349349 /**
350350 * Perform an edit from the update data
351351 * @throws OAIError
@@ -357,21 +357,21 @@
358358 $this->getArticleId(),
359359 $this->_page['title'] ) );
360360 }
361 -
 361+
362362 $id = 0;
363363 foreach( $this->_page['revisions'] as $revision ) {
364364 $id = $this->applyRevision( $revision );
365365 }
366 -
 366+
367367 RefreshLinks::fixLinksFromArticle( $id );
368 -
 368+
369369 if( isset( $this->_page['uploads'] ) ) {
370370 foreach( $this->_page['uploads'] as $upload ) {
371371 $this->applyUpload( $upload );
372372 }
373373 }
374374 }
375 -
 375+
376376 /**
377377 * Apply a revision update.
378378 * @param array $data
@@ -380,10 +380,10 @@
381381 $title = $this->getTitle();
382382 $pageId = $this->getArticleId();
383383 $timestamp = $this->getTimestamp( $data['timestamp'] );
384 -
 384+
385385 $dbw = wfGetDB( DB_WRITE );
386386 $dbw->begin();
387 -
 387+
388388 if( $data['id'] ) {
389389 $conflictingRevision = Revision::newFromId( $data['id'] );
390390 if( $conflictingRevision ) {
@@ -392,10 +392,10 @@
393393 return;
394394 }
395395 }
396 -
 396+
397397 // Take a look...
398398 $article = $this->prepareArticle( $dbw, $pageId, $title );
399 -
 399+
400400 // Insert a revision
401401 $revision = new Revision( array(
402402 'id' => isset( $data['id'] ) ? intval( $data['id'] ) : null,
@@ -411,13 +411,13 @@
412412 ) );
413413 $revId = $revision->insertOn( $dbw );
414414 echo "UPDATING to rev $revId\n";
415 -
 415+
416416 // Update the page record
417417 $article->updateRevisionOn( $dbw, $revision );
418 -
 418+
419419 $dbw->commit();
420420 }
421 -
 421+
422422 /**
423423 * @param int $pageId
424424 * @param Title $title
@@ -425,18 +425,18 @@
426426 */
427427 function prepareArticle( $db, $pageId, $title ) {
428428 $fname = 'OAIUpdateRecord::prepareArticle';
429 -
 429+
430430 $article = new Article( $title );
431431 $foundId = $article->getId();
432 -
 432+
433433 if( $foundId == $pageId ) {
434434 return $article;
435435 }
436 -
 436+
437437 if( $foundId != 0 ) {
438438 $this->hideConflictingPage( $db, $foundId, $title );
439439 }
440 -
 440+
441441 // Check to see if the page exists under a different title
442442 $foundTitle = Title::newFromId( $pageId );
443443 if( $foundTitle ) {
@@ -470,7 +470,7 @@
471471 $title->resetArticleID( -1 );
472472 return new Article( $title );
473473 }
474 -
 474+
475475 /**
476476 * Rename a conflicting page record
477477 * @param Database $db
@@ -485,7 +485,7 @@
486486 array( 'page_id' => $existing ),
487487 'OAIUpdateRecord::hideConflictingPage' );
488488 }
489 -
 489+
490490 /**
491491 * Update an image record
492492 * @param array $upload
@@ -493,7 +493,7 @@
494494 */
495495 function applyUpload( $upload ) {
496496 $fname = 'OAIUpdateRecord::applyUpload';
497 -
 497+
498498 # FIXME: validate these files...
499499 if( strpos( $upload['filename'], '/' ) !== false
500500 || strpos( $upload['filename'], '\\' ) !== false
@@ -501,7 +501,7 @@
502502 || $upload['filename'] !== trim( $upload['filename'] ) ) {
503503 throw new OAIError( 'Invalid filename "' . $upload['filename'] . '"' );
504504 }
505 -
 505+
506506 $dbw = wfGetDB( DB_MASTER );
507507 $data = array(
508508 'img_name' => $upload['filename'],
@@ -513,15 +513,15 @@
514514 : strval( $upload['contributor']['ip'] ),
515515 'img_timestamp' => $dbw->timestamp( $this->getTimestamp( $upload['timestamp'] ) ),
516516 'img_metadata' => serialize( array() ) );
517 -
 517+
518518 $dbw->begin();
519519 echo "REPLACING image row\n";
520520 $dbw->replace( 'image', array( 'img_name' ), $data, $fname );
521521 $dbw->commit();
522 -
 522+
523523 $this->downloadUpload( $upload );
524524 }
525 -
 525+
526526 /**
527527 * Fetch a file to go with an updated image record
528528 * $param array $upload update info data
@@ -534,7 +534,7 @@
535535 $upload['src'] . "'.\n";
536536 return;
537537 }
538 -
 538+
539539 # We assume the filename has already been validated by code above us.
540540 echo "File updating temporarily broken on 1.11, sorry!\n";
541541 return;
@@ -546,20 +546,20 @@
547547 echo "Local file $filename matches; skipping download.\n";
548548 return;
549549 }
550 -
 550+
551551 if( !preg_match( '!^http://!', $upload['src'] ) )
552552 throw new OAIError( 'Invalid image source URL "' . $upload['src'] . "'." );
553 -
 553+
554554 $input = fopen( $upload['src'], 'rb' );
555555 if( !$input ) {
556556 unlink( $filename );
557557 throw new OAIError( 'Could not fetch image source URL "' . $upload['src'] . "'." );
558558 }
559 -
 559+
560560 if( file_exists( $filename ) ) {
561561 unlink( $filename );
562562 }
563 - wfMkdirParents( dirname( $filename ) );
 563+ wfMkdirParents( dirname( $filename ), null, __METHOD__ );
564564 if( !( $output = fopen( $filename, 'xb' ) ) ) {
565565 throw new OAIError( 'Could not create local image file "' . $filename . '" for writing.' );
566566 }
@@ -572,33 +572,33 @@
573573 }
574574 fclose( $input );
575575 fclose( $output );
576 -
 576+
577577 touch( $filename, $timestamp );
578578 echo " done.\n";
579579 }
580 -
 580+
581581 /**
582582 * Delete the page record.
583583 */
584584 function doDelete() {
585585 $dbw = wfGetDB( DB_MASTER );
586586 $dbw->begin();
587 -
 587+
588588 $title = Title::newFromId( $this->getArticleId() );
589589 if( $title ) {
590590 $article = new Article( $title );
591 -
 591+
592592 echo "DELETING\n";
593593 $article->doDeleteArticle( 'deleted from parent repository' );
594594 } else {
595595 echo "DELETING (not present)\n";
596596 }
597 -
 597+
598598 $dbw->commit();
599 -
 599+
600600 return true;
601601 }
602 -
 602+
603603 /**
604604 * @param DomNode $node
605605 */
@@ -607,7 +607,7 @@
608608 $record = new OAIUpdateRecord( $pageData );
609609 return $record;
610610 }
611 -
 611+
612612 /**
613613 * Collect page info out of an OAI record node containing export data.
614614 * @param DOMNode $node
@@ -637,7 +637,7 @@
638638 <minor>
639639 */
640640 $header = oaiNextChild( $node, 'header' );
641 -
 641+
642642 if( $header->getAttribute( 'status' ) == 'deleted' ) {
643643 $pagedata = OAIUpdateRecord::grabDeletedPage( $header );
644644 } else {
@@ -646,15 +646,15 @@
647647 $page = oaiNextChild( $mediawiki, 'page' );
648648 $pagedata = OAIUpdateRecord::grabPage( $page );
649649 }
650 -
 650+
651651 // We'll also need the OAI datestamp to ensure
652652 // update stream continuity...
653653 $datestamp = oaiNextChild( $header, 'datestamp' );
654654 $pagedata['oai_timestamp'] = wfTimestamp( TS_MW, $datestamp->textContent );
655 -
 655+
656656 return $pagedata;
657657 }
658 -
 658+
659659 /**
660660 * Extract deleted page information from the OAI record
661661 * @param DOMNode $header
@@ -668,18 +668,18 @@
669669 </header>
670670 */
671671 $identifier = oaiNextChild( $header, 'identifier' );
672 -
 672+
673673 $ident = $identifier->textContent;
674674 $bits = explode( ':', $ident );
675675 $id = intval( $bits[count( $bits ) - 1] );
676676 if( $id <= 0 )
677677 throw new OAIError( "Couldn't understand deleted page identifier '$ident'" );
678 -
 678+
679679 return array(
680680 'id' => $id,
681681 'deleted' => true );
682682 }
683 -
 683+
684684 /**
685685 * Extract non-deleted page information from the OAI record
686686 * @param DOMNode $page
@@ -709,7 +709,7 @@
710710 }
711711 return $data;
712712 }
713 -
 713+
714714 /**
715715 * @param DOMNode $revision
716716 */
@@ -732,7 +732,7 @@
733733 'size',
734734 'contributor' => array( 'OAIUpdateRecord', 'grabContributor' ) ) );
735735 }
736 -
 736+
737737 function grabContributor( $node ) {
738738 return oaiNodeMap( $node, array(
739739 'id',
@@ -777,7 +777,7 @@
778778 }
779779 }
780780 }
781 -
 781+
782782 return $data;
783783 }
784784
@@ -795,7 +795,7 @@
796796 if( $node->nodeType == XML_ELEMENT_NODE
797797 && ( is_null( $element ) || $node->nodeName == $element ) )
798798 return $node;
799 -
 799+
800800 return new OAIError(
801801 is_null( $element )
802802 ? "No more elements"
Index: trunk/extensions/Math/Math.body.php
@@ -53,7 +53,7 @@
5454 if( $wgMathCheckFiles ) {
5555 # Ensure that the temp and output directories are available before continuing...
5656 if( !file_exists( $wgTmpDirectory ) ) {
57 - if( !wfMkdirParents( $wgTmpDirectory ) ) {
 57+ if( !wfMkdirParents( $wgTmpDirectory, null, __METHOD__ ) ) {
5858 return $this->_error( 'math_bad_tmpdir' );
5959 }
6060 } elseif( !is_dir( $wgTmpDirectory ) || !is_writable( $wgTmpDirectory ) ) {
@@ -160,7 +160,7 @@
161161 $hashpath = $this->_getHashPath();
162162 if( !file_exists( $hashpath ) ) {
163163 wfSuppressWarnings();
164 - $ret = wfMkdirParents( $hashpath, 0755 );
 164+ $ret = wfMkdirParents( $hashpath, 0755, __METHOD__ );
165165 wfRestoreWarnings();
166166 if( !$ret ) {
167167 return $this->_error( 'math_bad_output' );
@@ -193,7 +193,7 @@
194194 __METHOD__
195195 );
196196 }
197 -
 197+
198198 // If we're replacing an older version of the image, make sure it's current.
199199 global $wgUseSquid;
200200 if ( $wgUseSquid ) {
@@ -240,12 +240,12 @@
241241 $this->mathml = $rpage->math_mathml;
242242
243243 $filename = $this->_getHashPath() . "/{$this->hash}.png";
244 -
 244+
245245 if( !$wgMathCheckFiles ) {
246246 // Short-circuit the file existence & migration checks
247247 return true;
248248 }
249 -
 249+
250250 if( file_exists( $filename ) ) {
251251 if( filesize( $filename ) == 0 ) {
252252 // Some horrible error corrupted stuff :(
@@ -262,7 +262,7 @@
263263
264264 if( !file_exists( $hashpath ) ) {
265265 wfSuppressWarnings();
266 - $ret = wfMkdirParents( $hashpath, 0755 );
 266+ $ret = wfMkdirParents( $hashpath, 0755, __METHOD__ );
267267 wfRestoreWarnings();
268268 if( !$ret ) {
269269 return false;
@@ -341,14 +341,14 @@
342342 $dir = $this->_getHashSubPath();
343343 return "$wgMathPath/$dir/{$this->hash}.png";
344344 }
345 -
 345+
346346 function _getHashPath() {
347347 global $wgMathDirectory;
348348 $path = $wgMathDirectory . '/' . $this->_getHashSubPath();
349349 wfDebug( "TeX: getHashPath, hash is: $this->hash, path is: $path\n" );
350350 return $path;
351351 }
352 -
 352+
353353 function _getHashSubPath() {
354354 return substr( $this->hash, 0, 1)
355355 . '/' . substr( $this->hash, 1, 1 )
Index: trunk/extensions/TimedMediaHandler/TimedMediaThumbnail.php
@@ -1,30 +1,30 @@
2 -<?php
 2+<?php
33 class TimedMediaThumbnail {
4 -
 4+
55 static function get( $options ){
66 global $wgFFmpegLocation, $wgOggThumbLocation;
77
88 // Set up lodal pointer to file
99 $file = $options['file'];
1010 if( !is_dir( dirname( $options['dstPath'] ) ) ){
11 - wfMkdirParents( dirname( $options['dstPath'] ) );
 11+ wfMkdirParents( dirname( $options['dstPath'] ), null, __METHOD__ );
1212 }
1313
14 - wfDebug( "Creating video thumbnail at" . $options['dstPath'] . "\n" );
 14+ wfDebug( "Creating video thumbnail at" . $options['dstPath'] . "\n" );
1515 // Else try ffmpeg and return result:
1616 return self::tryFfmpegThumb( $options );
1717 }
18 -
 18+
1919 static function tryFfmpegThumb( $options ){
2020 global $wgFFmpegLocation;
21 -
 21+
2222 $cmd = wfEscapeShellArg( $wgFFmpegLocation ) .
2323 ' -i ' . wfEscapeShellArg( $options['file']->getPath() );
24 - // Set the output size if set in options:
 24+ // Set the output size if set in options:
2525 if( isset( $options['width'] ) && isset( $options['height'] ) ){
2626 $cmd.= ' -s '. intval( $options['width'] ) . 'x' . intval( $options['height'] );
2727 }
28 -
 28+
2929 $cmd.=' -ss ' . intval( self::getThumbTime( $options ) ) .
3030 # MJPEG, that's the same as JPEG except it's supported by the windows build of ffmpeg
3131 # No audio, one frame
@@ -51,23 +51,23 @@
5252 return new MediaTransformError( 'thumbnail_error', $options['width'], $options['height'], implode( "\n", $lines ) );
5353 }
5454
55 - static function getThumbTime( $options ){
 55+ static function getThumbTime( $options ){
5656 $length = $options['file']->getLength();
5757 $thumbtime = false;
58 -
 58+
5959 // If start time param isset use that for the thumb:
6060 if( isset( $options['start'] ) ) {
6161 $thumbtime = TimedMediaHandler::parseTimeString( $options['start'], $length );
6262 if( $thumbtime )
63 - return $thumbtime;
 63+ return $thumbtime;
6464 }
6565 // else use thumbtime
6666 if ( isset( $options['thumbtime'] ) ) {
6767 $thumbtime = TimedMediaHandler::parseTimeString( $options['thumbtime'], $length );
6868 if( $thumbtime )
69 - return $thumbtime;
70 - }
 69+ return $thumbtime;
 70+ }
7171 // Seek to midpoint by default, it tends to be more interesting than the start
7272 return $length / 2;
7373 }
74 -}
\ No newline at end of file
 74+}
Index: trunk/extensions/FundraiserPortal/rebuildButtons.php
@@ -12,16 +12,16 @@
1313 echo "Usage:\n";
1414 echo " php extensions/FundraiserPortal/rebuildButtons.php [-o|Output to disk]\n";
1515 } else {
16 - echo "Rebuilding button templates ...\n";
17 -
 16+ echo "Rebuilding button templates ...\n";
 17+
1818 $builder = new DonateButton();
1919 $js = $builder->getJsOutput();
2020
2121 if ( isset( $options['o'] ) ) {
2222 $lang = $wgLang->getCode();
2323 $outputDir = "$wgFundraiserPortalDirectory/wikipedia/$lang";
24 - if ( wfMkDirParents( $outputDir ) ) {
25 -
 24+ if ( wfMkDirParents( $outputDir, null, __METHOD__ ) ) {
 25+
2626 $outputFile = "$outputDir/fundraiserportal.js";
2727 $ok = file_put_contents( $outputFile, $js );
2828 if ( !$ok ) {
Index: trunk/extensions/Translate/scripts/magic-export.php
@@ -108,7 +108,7 @@
109109 }
110110
111111 $outFile = $this->target . '/' . $filename;
112 - wfMkdirParents( dirname( $outFile ) );
 112+ wfMkdirParents( dirname( $outFile ), null, __METHOD__ );
113113 $this->handles[$group->getId()] = fopen( $outFile, 'w' );
114114 fwrite( $this->handles[$group->getId()], $this->readHeader( $inFile ) );
115115
Index: trunk/extensions/Translate/ffs/Simple.php
@@ -152,7 +152,7 @@
153153 }
154154 $target = $targetDirectory . '/' . $filename;
155155
156 - wfMkdirParents( dirname( $target ) );
 156+ wfMkdirParents( dirname( $target ), null, __METHOD__ );
157157 $handle = fopen( $target, 'wt' );
158158
159159 if ( $handle === false ) {
Index: trunk/extensions/Translate/ffs/WikiExtension.php
@@ -101,7 +101,7 @@
102102 $filename = $this->group->getMessageFile( '' );
103103 $target = $targetDirectory . '/' . $filename;
104104
105 - wfMkdirParents( dirname( $target ) );
 105+ wfMkdirParents( dirname( $target ), null, __METHOD__ );
106106 $handle = fopen( $target, 'wt' );
107107 if ( $handle === false ) {
108108 throw new MWException( "Unable to open target for writing" );
Index: trunk/extensions/PdfHandler/PdfHandler_body.php
@@ -115,7 +115,7 @@
116116 $height, $dstPath, $page );
117117 }
118118
119 - if ( !wfMkdirParents( dirname( $dstPath ) ) ) {
 119+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
120120 return $this->doThumbError( $width, $height, 'thumbnail_dest_directory' );
121121 }
122122
Index: trunk/extensions/EditMessages/EditMessages_body.php
@@ -8,7 +8,7 @@
99
1010 function execute( $subpage = '' ) {
1111 global $wgOut, $wgRequest;
12 -
 12+
1313 $this->setHeaders();
1414
1515 $messageName = $wgRequest->getVal( 'messageName' );
@@ -121,7 +121,7 @@
122122 );
123123 $dcRegex = '/[0-7]{1,3}|x[0-9A-Fa-f]{1,2}/';
124124
125 - wfMkdirParents( "$wgTmpDirectory/EditMessages" );
 125+ wfMkdirParents( "$wgTmpDirectory/EditMessages", null, __METHOD__ );
126126 $out = '';
127127 foreach ( $originalMsgs as $lang => $origValue ) {
128128 if ( !isset( $newMsgs[$lang] ) ) {
Index: trunk/extensions/WikiAtHome/ApiWikiAtHome.php
@@ -153,7 +153,7 @@
154154 if( !$status->isGood() ){
155155 return $this->dieUsageMsg( array('code'=>'fileerror', 'info'=>'Could Not Move The Uploaded File') );
156156 }*/
157 - wfMkdirParents( $thumbPath );
 157+ wfMkdirParents( $thumbPath, null, __METHOD__ );
158158 if( !move_uploaded_file($uploadedJobFile, $destTarget) ){
159159 return $this->dieUsage( 'Could Not Move The Uploaded File', 'fileerror' );
160160 }
Index: trunk/extensions/WikiAtHome/NonFreeVideoHandler.php
@@ -158,7 +158,7 @@
159159 # Seek to midpoint by default, it tends to be more interesting than the start
160160 $thumbTime = $length / 2;
161161 }
162 - wfMkdirParents( dirname( $dstPath ) );
 162+ wfMkdirParents( dirname( $dstPath ), null, __METHOD__ );
163163 if(!is_file($dstPath)){
164164 $cmd = wfEscapeShellArg( $wgFFmpegLocation ) .
165165 ' -ss ' . intval( $thumbTime ) . ' ' .
Index: trunk/extensions/WikiAtHome/internalCmdLineEncoder.php
@@ -60,7 +60,7 @@
6161 $file = wfLocalFile( $fTitle );
6262 $thumbPath = $file->getThumbPath( $jobSet->set_encodekey );
6363 //make sure the directory is ready:
64 - wfMkdirParents( $thumbPath );
 64+ wfMkdirParents( $thumbPath, null, __METHOD__ );
6565
6666 $destTarget = $thumbPath . '.ogg';
6767 //issue the encoding command
Index: trunk/extensions/TrustedMath/TrustedMath_body.php
@@ -36,7 +36,7 @@
3737 public function __construct( $text ) {
3838 $this->text = $text;
3939 }
40 -
 40+
4141 /**
4242 * Get the base16 md5 hash of the equation
4343 * @return string Base 16 hash of the equation
@@ -49,13 +49,13 @@
5050 }
5151 /**
5252 * Get the two level relative hash path of the equation
53 - * @return string
 53+ * @return string
5454 */
5555 protected function getHashPath() {
5656 $hash = $this->getHash();
5757 return $hash{0} . '/' . $hash{0} . $hash{1};
5858 }
59 -
 59+
6060 /**
6161 * Get the LaTeX equation text
6262 * @return string
@@ -63,7 +63,7 @@
6464 public function getText() {
6565 return $this->text;
6666 }
67 -
 67+
6868 /**
6969 * Set the path to the latex and dvipng renders
7070 * @param string $latex
@@ -87,14 +87,14 @@
8888 public function setEnvironment( $environ ) {
8989 $this->environ = $environ;
9090 }
91 -
 91+
9292 /**
93 - * Render the LaTeX equation as PNG and store it into
 93+ * Render the LaTeX equation as PNG and store it into
9494 * $wgTrustedMathDirectory under a two level hash path. Will not re-render
9595 * if the file already exists
96 - *
 96+ *
9797 * @param bool $force Force re-rendering the file
98 - * @return Status Status object with $value set to the relative path of
 98+ * @return Status Status object with $value set to the relative path of
9999 * the rendered equation on success.
100100 */
101101 public function render( $force = false ) {
@@ -102,54 +102,54 @@
103103 $hash = $this->getHash();
104104 $hashPath = $this->getHashPath();
105105 $filePath = "{$this->dir}/$hashPath/$hash.png";
106 -
 106+
107107 // Check equation existence
108 - if ( !$force && file_exists( $filePath ) &&
 108+ if ( !$force && file_exists( $filePath ) &&
109109 filesize( $filePath ) > 0 ) {
110 - return Status::newGood( "$hashPath/$hash.png" );
 110+ return Status::newGood( "$hashPath/$hash.png" );
111111 }
112 -
 112+
113113 // Create the hash path
114114 wfSuppressWarnings();
115 - if ( !wfMkDirParents( "{$this->dir}/$hashPath" ) ) {
 115+ if ( !wfMkDirParents( "{$this->dir}/$hashPath", null, __METHOD__ ) ) {
116116 wfRestoreWarnings();
117117 return Status::newFatal( 'trustedmath-path-error', $hashPath );
118118 }
119119 wfRestoreWarnings();
120 -
 120+
121121 // Create a random file, wrap the equation in LaTeX and store it
122122 $file = "{$this->dir}/$hash" . wfBaseConvert( mt_rand(), 10, 36 );
123123 file_put_contents( "$file.tex", self::wrapEquation( $this->getText() ) );
124 -
 124+
125125 $retval = null;
126 -
 126+
127127 // Render the LaTeX file as DVI
128 - $output = wfShellExec( wfEscapeShellArg( $this->latex,
129 - '-halt-on-error', '-output-directory',
 128+ $output = wfShellExec( wfEscapeShellArg( $this->latex,
 129+ '-halt-on-error', '-output-directory',
130130 $this->dir, "$file.tex" ) . ' 2>&1', $retval, $this->environ );
131131 if ( !file_exists( "$file.dvi" ) ) {
132132 // Something went wrong, return the output of the latex command
133133 $this->cleanup( $file );
134 - return Status::newFatal( 'trustedmath-convert-error',
 134+ return Status::newFatal( 'trustedmath-convert-error',
135135 $this->latex, $output );
136136 }
137 -
 137+
138138 // Render the DVI file as PNG
139 - $output = wfShellExec( wfEscapeShellArg( $this->dvipng ) .
140 - ' -D 150 -T tight -v -o ' .
 139+ $output = wfShellExec( wfEscapeShellArg( $this->dvipng ) .
 140+ ' -D 150 -T tight -v -o ' .
141141 wfEscapeShellArg( $filePath, "$file.dvi" ), $retval, $this->environ );
142142 if ( !file_exists( $filePath ) ) {
143143 // Something went wrong, return the output of the dvipng command
144144 $this->cleanup( $file );
145 - return Status::newFatal( 'trustedmath-convert-error',
 145+ return Status::newFatal( 'trustedmath-convert-error',
146146 $this->dvipng, $output );
147147 }
148 -
 148+
149149 // Everything ok, return the path
150150 $this->cleanup( $file );
151151 return Status::newGood( "$hashPath/$hash.png" );
152152 }
153 -
 153+
154154 /**
155155 * Wrap a LaTeX equation in the minimum amount required to render it
156156 * @param string $equation
@@ -159,7 +159,7 @@
160160 return implode( "\n", array(
161161 '\documentclass{article}',
162162 '\pagestyle{empty}',
163 - '\usepackage{amsmath}',
 163+ '\usepackage{amsmath}',
164164 '\begin{document}',
165165 '\begin{equation*}',
166166 trim( $equation ),
@@ -167,22 +167,22 @@
168168 '\end{document}',
169169 ) );
170170 }
171 -
 171+
172172 /**
173 - * Clean-up the mess left behind by the rendering process. Deletes all
 173+ * Clean-up the mess left behind by the rendering process. Deletes all
174174 * files whose name without extension is equation to $file
175 - * @param string $file The file name including path to it
 175+ * @param string $file The file name including path to it
176176 */
177177 protected static function cleanup( $file ) {
178178 $dir = dirname( $file );
179 - $iter = new RegexIterator( new DirectoryIterator( $dir ),
 179+ $iter = new RegexIterator( new DirectoryIterator( $dir ),
180180 '#^' . preg_quote( basename( $file ) ) . '\..*$#' );
181 -
 181+
182182 wfSuppressWarnings();
183183 foreach ( $iter as $file ) {
184184 unlink( "$dir/$file" );
185185 }
186186 wfRestoreWarnings();
187187 }
188 -
 188+
189189 }
Index: trunk/extensions/WebStore/store.php
@@ -37,11 +37,11 @@
3838 $this->cleanupTemp( $now );
3939
4040 $timestamp = gmdate( self::$tempDirFormat, $now );
41 - if ( !wfMkdirParents( "{$this->tmpDir}/$timestamp" ) ) {
 41+ if ( !wfMkdirParents( "{$this->tmpDir}/$timestamp", null, __METHOD__ ) ) {
4242 $this->error( 500, 'webstore_dest_mkdir' );
4343 return false;
4444 }
45 -
 45+
4646 // Get the extension of the upload, needs to be preserved for type detection
4747 $name = $wgRequest->getFileName( 'file' );
4848 $n = strrpos( $name, '.' );
Index: trunk/extensions/WebStore/inplace-scaler.php
@@ -22,7 +22,7 @@
2323 break;
2424 }
2525 }
26 -
 26+
2727 if ( !$allowed ) {
2828 $this->htmlError( 403, 'inplace_access_denied' );
2929 return false;
@@ -48,7 +48,7 @@
4949
5050 $tempDir = $this->tmpDir . '/' . gmdate( self::$tempDirFormat );
5151 if ( !is_dir( $tempDir ) ) {
52 - if ( !wfMkdirParents( $tempDir ) ) {
 52+ if ( !wfMkdirParents( $tempDir, null, __METHOD__ ) ) {
5353 $this->htmlError( 500, 'inplace_scaler_no_temp' );
5454 return false;
5555 }
@@ -59,7 +59,7 @@
6060
6161 $params = $_REQUEST;
6262 unset( $params['file'] );
63 - if ( get_magic_quotes_gpc() ) {
 63+ if ( get_magic_quotes_gpc() ) {
6464 $params = array_map( 'stripslashes', $params );
6565 }
6666
@@ -126,7 +126,7 @@
127127 }
128128 }
129129
130 -// Fatal errors can cause PHP to spew out some HTML and exit with a 200 response,
 130+// Fatal errors can cause PHP to spew out some HTML and exit with a 200 response,
131131 // which would leave a corrupt image file permanently on disk. Prevent this from
132132 // happening.
133133 ini_set( 'display_errors', false );
Index: trunk/extensions/WebStore/WebStoreCommon.php
@@ -41,7 +41,7 @@
4242 }
4343 $this->windows = wfIsWindows();
4444
45 -
 45+
4646 }
4747
4848 function setErrorHandler() {
@@ -184,7 +184,7 @@
185185 $success = true;
186186 do {
187187 // Create destination directory
188 - if ( !wfMkdirParents( dirname( $dstPath ) ) ) {
 188+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) {
189189 $this->errors[] = new WebStoreError( 'webstore_dest_mkdir', $dstPath );
190190 $success = false;
191191 break;
@@ -253,7 +253,7 @@
254254 do {
255255 // Create destination directory
256256 $dstDir = dirname( $dstPath );
257 - if ( !wfMkdirParents( $dstDir ) ) {
 257+ if ( !wfMkdirParents( $dstDir, null, __METHOD__ ) ) {
258258 $this->errors[] = new WebStoreError( 'webstore_dest_mkdir', $dstDir );
259259 $success = false;
260260 break;
Index: trunk/extensions/WebStore/publish.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Move a temporary file to a public directory, and archive the existing file
 5+ * Move a temporary file to a public directory, and archive the existing file
66 * if there was one.
77 */
88
@@ -53,16 +53,16 @@
5454 $archiveRel = $wgRequest->getVal( 'archive' );
5555
5656 // Check for directory traversal
57 - if ( !$this->validateFilename( $srcRel ) ||
58 - !$this->validateFilename( $dstRel ) ||
 57+ if ( !$this->validateFilename( $srcRel ) ||
 58+ !$this->validateFilename( $dstRel ) ||
5959 !$this->validateFilename( $archiveRel ) )
6060 {
6161 $this->error( 400, 'webstore_path_invalid' );
6262 return false;
6363 }
6464
65 - // Don't publish into odd subdirectories of the public zone.
66 - // Some directories may be temporary caches with a potential for
 65+ // Don't publish into odd subdirectories of the public zone.
 66+ // Some directories may be temporary caches with a potential for
6767 // data loss.
6868 if ( !preg_match( '!^archive|[a-zA-Z0-9]/!', $dstRel ) ) {
6969 $this->error( 400, 'webstore_path_invalid' );
@@ -70,8 +70,8 @@
7171 }
7272
7373 // Don't move anything to a filename that ends with the reserved suffix
74 - if ( substr( $dstRel, -12 ) == '.MW_WebStore' ||
75 - substr( $archiveRel, -12 ) == '.MW_WebStore' )
 74+ if ( substr( $dstRel, -12 ) == '.MW_WebStore' ||
 75+ substr( $archiveRel, -12 ) == '.MW_WebStore' )
7676 {
7777 $this->error( 400, 'webstore_path_invalid' );
7878 return false;
@@ -138,7 +138,7 @@
139139 do {
140140 // Create archive directory
141141 $archiveDir = dirname( $archivePath );
142 - if ( !wfMkdirParents( $archiveDir ) ) {
 142+ if ( !wfMkdirParents( $archiveDir, null, __METHOD__ ) ) {
143143 $this->errors[] = new WebStoreError( 'webstore_archive_mkdir', $archiveDir );
144144 $success = false;
145145 break;
@@ -171,11 +171,11 @@
172172 break;
173173 }
174174
175 - // Copy the old file to the archive. Leave a copy in place in its
 175+ // Copy the old file to the archive. Leave a copy in place in its
176176 // current location for now so that webserving continues to work.
177177 // If we had access to the real C rename() call, then we could use
178 - // link() instead and avoid the copy, but the chance that PHP might
179 - // copy and delete on the subsequent rename() call, thereby overwriting
 178+ // link() instead and avoid the copy, but the chance that PHP might
 179+ // copy and delete on the subsequent rename() call, thereby overwriting
180180 // the archive, makes this a dangerous option.
181181 //
182182 // NO_LOCK option because we already have the lock
@@ -199,7 +199,7 @@
200200 $success = $this->copyPath( $srcPath, $dstPath, self::NO_LOCK | self::OVERWRITE );
201201 }
202202 } while (false);
203 -
 203+
204204 // Close the lock files
205205 if ( $archiveLockFile ) {
206206 if ( !$this->closeAndDelete( $archiveLockFile, $archiveLockPath ) ) {
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -332,7 +332,7 @@
333333 $height, $dstPath, $page );
334334 }
335335
336 - if ( !wfMkdirParents( dirname( $dstPath ) ) )
 336+ if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) )
337337 return $this->doThumbError( $params, 'thumbnail_dest_directory' );
338338
339339 if ( $wgTiffUseVips ) {
Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php
@@ -4,6 +4,19 @@
55 }
66
77 class SpecialAbuseLog extends SpecialPage {
 8+
 9+ /**
 10+ * @var User
 11+ */
 12+ protected $mSearchUser;
 13+
 14+ /**
 15+ * @var Title
 16+ */
 17+ protected $mSearchTitle;
 18+
 19+ protected $mSearchFilter;
 20+
821 public function __construct() {
922 parent::__construct( 'AbuseLog', 'abusefilter-log' );
1023 }
@@ -315,16 +328,25 @@
316329 $wgOut->addHTML( $output );
317330 }
318331
 332+ /**
 333+ * @return bool
 334+ */
319335 static function canSeeDetails() {
320336 global $wgUser;
321337 return $wgUser->isAllowed( 'abusefilter-log-detail' );
322338 }
323339
 340+ /**
 341+ * @return bool
 342+ */
324343 static function canSeePrivate() {
325344 global $wgUser;
326345 return $wgUser->isAllowed( 'abusefilter-private' );
327346 }
328347
 348+ /**
 349+ * @return bool
 350+ */
329351 static function canSeeHidden() {
330352 global $wgUser;
331353 return $wgUser->isAllowed( 'abusefilter-hidden-log' );
@@ -463,6 +485,10 @@
464486 return $li ? Xml::tags( 'li', null, $description ) : $description;
465487 }
466488
 489+ /**
 490+ * @param $db DatabaseBase
 491+ * @return string
 492+ */
467493 public static function getNotDeletedCond( $db ) {
468494 $deletedZeroCond = $db->makeList(
469495 array( 'afl_deleted' => 0 ), LIST_AND );
Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php
@@ -50,7 +50,7 @@
5151 }
5252 $this->period = $period;
5353 $this->dScale = 20;
54 -
 54+
5555 $this->now = time(); // one time for whole request
5656
5757 $this->showForm();
@@ -66,7 +66,7 @@
6767 }
6868 $this->showGraphs();
6969 }
70 -
 70+
7171 protected function showTable() {
7272 global $wgOut;
7373 # Show latest month of results
@@ -81,7 +81,7 @@
8282 );
8383 }
8484 }
85 -
 85+
8686 protected function showForm() {
8787 global $wgOut, $wgScript;
8888 $form = Xml::openElement( 'form', array( 'name' => 'reviewedpages',
@@ -96,7 +96,7 @@
9797 $form .= "</fieldset></form>\n";
9898 $wgOut->addHTML( $form );
9999 }
100 -
 100+
101101 /**
102102 * Get a selector of time period options
103103 * @param int $selected, selected level
@@ -111,7 +111,7 @@
112112 $s .= Xml::closeElement('select')."\n";
113113 return $s;
114114 }
115 -
 115+
116116 protected function showGraphs() {
117117 global $wgOut;
118118 $data = false;
@@ -157,7 +157,7 @@
158158 }
159159 $html .= "<h3>" . wfMsgHtml("readerfeedback-$tag") . "$viewLink</h3>\n" .
160160 Xml::openElement( 'div', array('class' => 'rfb-reader_feedback_graph') ) .
161 - Xml::openElement( 'img', array('src' => $url,'alt' => $tag) ) .
 161+ Xml::openElement( 'img', array('src' => $url,'alt' => $tag) ) .
162162 Xml::closeElement( 'img' ) .
163163 Xml::closeElement( 'div' ) . "\n" .
164164 wfMsgExt('ratinghistory-graph-scale', 'parse', $this->dScale ) . "\n";
@@ -200,7 +200,7 @@
201201 }
202202 $wgOut->addHTML( $html );
203203 }
204 -
 204+
205205 /**
206206 * Generate an HTML table for this tag
207207 * @param string $tag
@@ -210,7 +210,7 @@
211211 public function makeHTMLTable( $tag, $filePath ) {
212212 $dir = dirname($filePath);
213213 // Make sure directory exists
214 - if( !is_dir($dir) && !wfMkdirParents( $dir, 0777 ) ) {
 214+ if( !is_dir($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) {
215215 return false;
216216 }
217217 // Define the data using the DB rows
@@ -250,7 +250,7 @@
251251 fclose( $fp );
252252 return $chart;
253253 }
254 -
 254+
255255 /**
256256 * Generate a graph for this tag
257257 * @param string $tag
@@ -269,7 +269,7 @@
270270 // Set file path
271271 $dir = dirname($filePath);
272272 // Make sure directory exists
273 - if( !file_exists($dir) && !wfMkdirParents( $dir, 0777 ) ) {
 273+ if( !file_exists($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) {
274274 throw new MWException( 'Could not create file directory!' );
275275 }
276276 $plot->SetOutputFile( $filePath );
@@ -350,7 +350,7 @@
351351 $plot->DrawGraph();
352352 return true;
353353 }
354 -
 354+
355355 /**
356356 * Generate a graph for this tag
357357 * @param string $tag
@@ -366,7 +366,7 @@
367367 // Set file path
368368 $dir = dirname($filePath);
369369 // Make sure directory exists
370 - if( !file_exists($dir) && !wfMkdirParents( $dir, 0777 ) ) {
 370+ if( !file_exists($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) {
371371 throw new MWException( 'Could not create file directory!' );
372372 }
373373 // Set some parameters
@@ -458,7 +458,7 @@
459459 $plot->styleTagsY = 'font-family: sans-serif; font-size: 11pt;';
460460 $plot->format['dave'] = array( 'style' => 'stroke:blue; stroke-width:1;' );
461461 $plot->format['rave'] = array( 'style' => 'stroke:green; stroke-width:1;' );
462 - $plot->format['dcount'] = array( 'style' => 'stroke:red; stroke-width:1;' );
 462+ $plot->format['dcount'] = array( 'style' => 'stroke:red; stroke-width:1;' );
463463 #'attributes' => "marker-end='url(#circle)'");
464464 $pageText = $wgContLang->truncate( $this->page->getPrefixedText(), 65 );
465465 $plot->title = wfMsgExt('ratinghistory-graph',array('parsemag','content'),
@@ -467,7 +467,7 @@
468468 $plot->backgroundStyle = 'fill:#F0F0F0;';
469469 // extra code for markers
470470 // FIXME: http://studio.imagemagick.org/pipermail/magick-bugs/2003-January/001038.html
471 - /* $plot->extraSVG =
 471+ /* $plot->extraSVG =
472472 '<defs>
473473 <marker id="circle" style="stroke:red; stroke-width:0; fill:red;"
474474 viewBox="0 0 10 10" refX="5" refY="7" orient="0"
@@ -508,7 +508,7 @@
509509 }
510510 return true;
511511 }
512 -
 512+
513513 protected function doQuery( $tag ) {
514514 // Set cutoff time for period
515515 $dbr = wfGetDB( DB_SLAVE );
@@ -517,7 +517,7 @@
518518 $cutoff = $dbr->addQuotes( wfTimestamp( TS_MW, $cutoff_unixtime ) );
519519 $res = $dbr->select( 'reader_feedback_history',
520520 array( 'rfh_total', 'rfh_count', 'rfh_date' ),
521 - array( 'rfh_page_id' => $this->page->getArticleId(),
 521+ array( 'rfh_page_id' => $this->page->getArticleId(),
522522 'rfh_tag' => $tag,
523523 "rfh_date >= {$cutoff}"),
524524 __METHOD__,
@@ -543,7 +543,7 @@
544544 }
545545 return array($res,$ave,$maxC,$days);
546546 }
547 -
 547+
548548 /**
549549 * Get the path to where the corresponding graph file should be
550550 * @param string $tag
@@ -555,7 +555,7 @@
556556 $rel = $this->getRelPath( $tag, $ext );
557557 return "{$wgUploadDirectory}/graphs/{$rel}";
558558 }
559 -
 559+
560560 /**
561561 * Get the url to where the corresponding graph file should be
562562 * @param string $tag
@@ -567,7 +567,7 @@
568568 $rel = $this->getRelPath( $tag, $ext );
569569 return "{$wgUploadPath}/graphs/{$rel}";
570570 }
571 -
 571+
572572 public function getRelPath( $tag, $ext = '' ) {
573573 $ext = $ext ? $ext : self::getCachedFileExtension();
574574 $pageId = $this->page->getArticleId();
@@ -577,7 +577,7 @@
578578 }
579579 return "{$pageId}/{$tag}/l{$this->period}d.{$ext}";
580580 }
581 -
 581+
582582 public static function getCachedFileExtension() {
583583 global $wgSvgGraphDir, $wgPHPlotDir;
584584 if( $wgSvgGraphDir || $wgPHPlotDir ) {
@@ -587,7 +587,7 @@
588588 }
589589 return $ext;
590590 }
591 -
 591+
592592 public static function getSourceFileExtension() {
593593 global $wgSvgGraphDir, $wgPHPlotDir;
594594 if( $wgSvgGraphDir ) {
@@ -599,7 +599,7 @@
600600 }
601601 return $ext;
602602 }
603 -
 603+
604604 protected function getUserList() {
605605 global $wgMemc;
606606 if( $this->period > 93 ) {
@@ -609,7 +609,7 @@
610610 // Check cache
611611 if( !$this->doPurge ) {
612612 $set = $wgMemc->get($key);
613 - // Cutoff is at the 24 hour mark due to the way the aggregate
 613+ // Cutoff is at the 24 hour mark due to the way the aggregate
614614 // schema groups ratings by date for graphs.
615615 $cache_cutoff = $this->now - ($this->now % 86400);
616616 if( is_array($set) && count($set) == 2 ) {
@@ -666,7 +666,7 @@
667667 $wgMemc->set( $key, array( $html, $this->now ), 24*3600 );
668668 return $html;
669669 }
670 -
 670+
671671 public function purgePage() {
672672 global $wgUploadDirectory;
673673 foreach( ReaderFeedback::getFeedbackTags() as $tag => $weight ) {
@@ -684,7 +684,7 @@
685685 }
686686 return true;
687687 }
688 -
 688+
689689 /**
690690 * Check if a graph file is expired. Set $this->dScale.
691691 * @param string $tag
@@ -717,7 +717,7 @@
718718 # If there are new votes, graph is stale
719719 return ( $file_unixtime < $tagTimestamp );
720720 }
721 -
 721+
722722 /**
723723 * Get highest touch timestamp of the tags. This uses a tiny filesort.
724724 * @param $page Title
@@ -725,7 +725,7 @@
726726 */
727727 public static function getTouched( $page ) {
728728 $dbr = wfGetDB( DB_SLAVE );
729 - $tagTimestamp = $dbr->selectField( 'reader_feedback_pages',
 729+ $tagTimestamp = $dbr->selectField( 'reader_feedback_pages',
730730 'MAX(rfp_touched)',
731731 array( 'rfp_page_id' => $page->getArticleId() ),
732732 __METHOD__ );
Index: trunk/extensions/DumpHTML/dumpHTML.inc
@@ -1180,7 +1180,7 @@
11811181
11821182 function mkdir( $dir ) {
11831183 //if ( wfIsWindows() ) {
1184 - return wfMkdirParents( $dir, 0755 );
 1184+ return wfMkdirParents( $dir, 0755, __METHOD__ );
11851185 /*} else {
11861186 $dir = escapeshellarg( $dir );
11871187 `mkdir -p -- $dir`;

Status & tagging log