Index: trunk/extensions/LiquidThreads/i18n/Lqt.namespaces.php |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | ); |
20 | 20 | |
21 | 21 | $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', |
26 | 26 | ); |
27 | 27 | |
28 | 28 | $namespaceNames['fi'] = array( |
Index: trunk/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | $thumbTime = $length / 2; |
264 | 264 | } |
265 | 265 | |
266 | | - wfMkdirParents( dirname( $dstPath ) ); |
| 266 | + wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ); |
267 | 267 | |
268 | 268 | global $wgOggThumbLocation; |
269 | 269 | if ( $wgOggThumbLocation !== false ) { |
— | — | @@ -271,7 +271,7 @@ |
272 | 272 | $status = $this->runFFmpeg( $file->getPath(), $dstPath, $thumbTime ); |
273 | 273 | } |
274 | 274 | if ( $status === true ) { |
275 | | - return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height, |
| 275 | + return new OggVideoDisplay( $file, $file->getURL(), $dstUrl, $width, $height, |
276 | 276 | $length, $dstPath ); |
277 | 277 | } else { |
278 | 278 | return new MediaTransformError( 'thumbnail_error', $width, $height, $status ); |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
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 |
284 | 284 | * to the given number of seconds from the start. |
285 | 285 | * |
286 | 286 | * Returns true on success, or an error message on failure. |
— | — | @@ -287,10 +287,10 @@ |
288 | 288 | function runFFmpeg( $videoPath, $dstPath, $time ) { |
289 | 289 | global $wgFFmpegLocation; |
290 | 290 | wfDebug( __METHOD__." creating thumbnail at $dstPath\n" ); |
291 | | - $cmd = wfEscapeShellArg( $wgFFmpegLocation ) . |
| 291 | + $cmd = wfEscapeShellArg( $wgFFmpegLocation ) . |
292 | 292 | # FFmpeg only supports integer numbers of seconds |
293 | 293 | ' -ss ' . intval( $time ) . ' ' . |
294 | | - ' -i ' . wfEscapeShellArg( $videoPath ) . |
| 294 | + ' -i ' . wfEscapeShellArg( $videoPath ) . |
295 | 295 | # MJPEG, that's the same as JPEG except it's supported ffmpeg |
296 | 296 | # No audio, one frame |
297 | 297 | ' -f mjpeg -an -vframes 1 ' . |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
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 |
323 | 323 | * close to the given number of seconds from the start. |
324 | 324 | * |
325 | 325 | * Returns true on success, or an error message on failure. |
— | — | @@ -335,11 +335,11 @@ |
336 | 336 | |
337 | 337 | if ( $this->removeBadFile( $dstPath, $retval ) || $retval ) { |
338 | 338 | // 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 |
340 | 340 | // something actually does go wrong. So interpreting its output is |
341 | 341 | // a challenge. |
342 | 342 | $lines = explode( "\n", str_replace( "\r\n", "\n", $returnText ) ); |
343 | | - if ( count( $lines ) > 0 |
| 343 | + if ( count( $lines ) > 0 |
344 | 344 | && preg_match( '/invalid option -- \'n\'$/', $lines[0] ) ) |
345 | 345 | { |
346 | 346 | return wfMsgForContent( 'ogg-oggThumb-version', '0.9' ); |
Index: trunk/extensions/FlvHandler/FlvImageHandler.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | wfDebug( __METHOD__.": $cmd\n" ); |
42 | 42 | $out = wfShellExec( $cmd, $retval ); |
43 | 43 | wfProfileOut( 'rsvg' ); |
44 | | - |
| 44 | + |
45 | 45 | if (preg_match($wgFLVProbes[$wgFLVConverter]['regex'], $out, $matches)) { |
46 | 46 | return array($matches[1], $matches[2]); // width/height |
47 | 47 | } else { |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | return new ThumbnailImage( $image, $dstUrl, $clientWidth, $clientHeight, $dstPath ); |
83 | 83 | } |
84 | 84 | |
85 | | - if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| 85 | + if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) { |
86 | 86 | return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, |
87 | 87 | wfMsg( 'thumbnail_dest_directory' ) ); |
88 | 88 | } |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | |
125 | 125 | function getLongDesc( $file ) { |
126 | 126 | global $wgLang; |
127 | | - |
| 127 | + |
128 | 128 | return wfMsgExt( 'flv-long-desc', 'parseinline', |
129 | 129 | $wgLang->formatNum( $file->getWidth() ), |
130 | 130 | $wgLang->formatNum( $file->getHeight() ), |
Index: trunk/extensions/OAI/OAIHarvest.php |
— | — | @@ -5,17 +5,17 @@ |
6 | 6 | * |
7 | 7 | * Copyright (C) 2005-2006 Brion Vibber <brion@pobox.com> |
8 | 8 | * http://www.mediawiki.org/ |
9 | | - * |
| 9 | + * |
10 | 10 | * This program is free software; you can redistribute it and/or modify |
11 | 11 | * 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 |
13 | 13 | * (at your option) any later version. |
14 | | - * |
| 14 | + * |
15 | 15 | * This program is distributed in the hope that it will be useful, |
16 | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | 18 | * GNU General Public License for more details. |
19 | | - * |
| 19 | + * |
20 | 20 | * You should have received a copy of the GNU General Public License along |
21 | 21 | * with this program; if not, write to the Free Software Foundation, Inc., |
22 | 22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | function __construct( $baseURL ) { |
63 | 63 | $this->_baseURL = $baseURL; |
64 | 64 | } |
65 | | - |
| 65 | + |
66 | 66 | /** |
67 | 67 | * Query the repository for updates, and run a callback for each item. |
68 | 68 | * Will continue across resumption tokens until there's nothing left. |
— | — | @@ -87,25 +87,25 @@ |
88 | 88 | 'from' => oaiDatestamp( $from ) ); |
89 | 89 | } |
90 | 90 | $xml = $this->callRepo( $params ); |
91 | | - |
| 91 | + |
92 | 92 | $doc = new DOMDocument( '1.0', 'utf-8' ); |
93 | 93 | if( !$doc->loadXML( $xml ) ) |
94 | 94 | throw new OAIError( "Invalid XML returned from OAI repository." ); |
95 | | - |
| 95 | + |
96 | 96 | $xp = new DOMXPath( $doc ); |
97 | 97 | $xp->registerNamespace( 'oai', 'http://www.openarchives.org/OAI/2.0/' ); |
98 | 98 | $errors = $this->checkResponseErrors( $xp ); |
99 | 99 | if( $errors ) { |
100 | 100 | return $errors; |
101 | 101 | } |
102 | | - |
| 102 | + |
103 | 103 | $resultSet = $xp->query( '/oai:OAI-PMH/oai:ListRecords/oai:record' ); |
104 | 104 | foreach( $resultSet as $node ) { |
105 | 105 | $record = OAIUpdateRecord::newFromNode( $node ); |
106 | 106 | call_user_func( $callback, $record ); |
107 | 107 | unset( $record ); |
108 | 108 | } |
109 | | - |
| 109 | + |
110 | 110 | $tokenSet = $xp->query( '/oai:OAI-PMH/oai:ListRecords/oai:resumptionToken' ); |
111 | 111 | $token = ( $tokenSet->length ) |
112 | 112 | ? $tokenSet->item( 0 )->textContent |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | } while( $token ); |
121 | 121 | return true; |
122 | 122 | } |
123 | | - |
| 123 | + |
124 | 124 | /** |
125 | 125 | * Check for OAI errors, and throw a formatted exception if present. |
126 | 126 | * |
— | — | @@ -130,17 +130,17 @@ |
131 | 131 | $errors = $xp->query( '/oai:OAI-PMH/oai:error' ); |
132 | 132 | if( !$errors ) |
133 | 133 | throw new OAIError( "Doesn't seem to be an OAI document...?" ); |
134 | | - |
| 134 | + |
135 | 135 | if( $errors->length == 0 ) |
136 | 136 | return; |
137 | | - |
| 137 | + |
138 | 138 | $messages = array(); |
139 | 139 | for( $i = 0; $i < $errors->length; $i++ ) { |
140 | 140 | $messages[$i] = $this->oaiErrorMessage( $errors->item( $i ) ); |
141 | 141 | } |
142 | 142 | throw new OAIError( implode( "\n", $messages ) ); |
143 | 143 | } |
144 | | - |
| 144 | + |
145 | 145 | /** |
146 | 146 | * Format a single OAI error response as a text message |
147 | 147 | * @param DomNode $node |
— | — | @@ -151,14 +151,14 @@ |
152 | 152 | $text = $node->textContent; |
153 | 153 | return "$code: $text"; |
154 | 154 | } |
155 | | - |
| 155 | + |
156 | 156 | function throwOAIErrors( $errors ) { |
157 | 157 | $message = array(); |
158 | 158 | foreach( $errors as $node ) { |
159 | 159 | $message[] = $node->x; |
160 | 160 | } |
161 | 161 | } |
162 | | - |
| 162 | + |
163 | 163 | /** |
164 | 164 | * Traverse a MediaWiki-format record set, sending an associative array |
165 | 165 | * of data to a callback function. |
— | — | @@ -172,11 +172,11 @@ |
173 | 173 | call_user_func( $callback, $data ); |
174 | 174 | } |
175 | 175 | } |
176 | | - |
| 176 | + |
177 | 177 | function extractMediaWiki( $node ) { |
178 | 178 | return array( 'everything' => 'testing' ); |
179 | 179 | } |
180 | | - |
| 180 | + |
181 | 181 | /** |
182 | 182 | * Contact the HTTP repository with a given set of parameters, |
183 | 183 | * and return the raw XML response data. |
— | — | @@ -196,12 +196,12 @@ |
197 | 197 | throw new OAIError( "Repository returned HTTP result code $resultCode" ); |
198 | 198 | } |
199 | 199 | } |
200 | | - |
| 200 | + |
201 | 201 | function requestURL( $params ) { |
202 | 202 | $sep = (strpos( $this->_baseURL, '?' ) == false) ? '?' : '&'; |
203 | 203 | return $this->_baseURL . $sep . wfArrayToCGI( $params ); |
204 | 204 | } |
205 | | - |
| 205 | + |
206 | 206 | function userAgent() { |
207 | 207 | global $oaiAgentExtra; |
208 | 208 | $agent = 'MediaWiki OAI Harvester 0.2 (http://www.mediawiki.org/)'; |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | } |
212 | 212 | return $agent; |
213 | 213 | } |
214 | | - |
| 214 | + |
215 | 215 | /** |
216 | 216 | * Fetch a resource from the web |
217 | 217 | * @param string $url |
— | — | @@ -222,12 +222,12 @@ |
223 | 223 | if( !ini_get( 'allow_url_fopen' ) ) { |
224 | 224 | throw new OAIError( "Can't open URLs; must turn on allow_url_fopen" ); |
225 | 225 | } |
226 | | - |
| 226 | + |
227 | 227 | $uagent = ini_set( 'user_agent', $this->userAgent() ); |
228 | 228 | echo "Fetching: $url\n"; |
229 | 229 | $result = file_get_contents( $url ); |
230 | 230 | ini_set( 'user_agent', $uagent ); |
231 | | - |
| 231 | + |
232 | 232 | # FIXME |
233 | 233 | if( $result === false ) { |
234 | 234 | $resultCode = 500; |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | } |
238 | 238 | return $result; |
239 | 239 | } |
240 | | - |
| 240 | + |
241 | 241 | function fetchURLviaCURL( $url, &$resultCode ) { |
242 | 242 | $fetch = curl_init( $url ); |
243 | 243 | if( defined( 'OAIDEBUG' ) ) { |
— | — | @@ -245,12 +245,12 @@ |
246 | 246 | # CURLOPT_TIMEOUT |
247 | 247 | # CURLOPT_REFERER? |
248 | 248 | curl_setopt( $fetch, CURLOPT_USERAGENT, $this->userAgent() ); |
249 | | - |
| 249 | + |
250 | 250 | ob_start(); |
251 | 251 | $ok = curl_exec( $fetch ); |
252 | 252 | $result = ob_get_contents(); |
253 | 253 | ob_end_clean(); |
254 | | - |
| 254 | + |
255 | 255 | $info = curl_getinfo( $fetch ); |
256 | 256 | if( !$ok ) { |
257 | 257 | echo "Something went awry...\n"; |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | die(); |
260 | 260 | } |
261 | 261 | curl_close( $fetch ); |
262 | | - |
| 262 | + |
263 | 263 | $resultCode = $info['http_code']; # ???? |
264 | 264 | return $result; |
265 | 265 | } |
— | — | @@ -266,23 +266,23 @@ |
267 | 267 | |
268 | 268 | class OAIUpdateRecord { |
269 | 269 | var $_page = array(); |
270 | | - |
| 270 | + |
271 | 271 | function __construct( $pageData ) { |
272 | 272 | $this->_page = $pageData; |
273 | 273 | } |
274 | | - |
| 274 | + |
275 | 275 | function getArticleId() { |
276 | 276 | return IntVal( $this->_page['id'] ); |
277 | 277 | } |
278 | | - |
| 278 | + |
279 | 279 | function isDeleted() { |
280 | 280 | return isset( $this->_page['deleted'] ); |
281 | 281 | } |
282 | | - |
| 282 | + |
283 | 283 | function getTitle() { |
284 | 284 | return Title::newFromText( $this->_page['title'] ); |
285 | 285 | } |
286 | | - |
| 286 | + |
287 | 287 | function getTimestamp( $time ) { |
288 | 288 | $matches = array(); |
289 | 289 | 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 @@ |
294 | 294 | return 0; |
295 | 295 | } |
296 | 296 | } |
297 | | - |
| 297 | + |
298 | 298 | function dump() { |
299 | 299 | if( $this->isDeleted() ) { |
300 | 300 | printf( "%14s %10d\n", '(deleted page)', $this->getArticleId() ); |
— | — | @@ -311,7 +311,7 @@ |
312 | 312 | } |
313 | 313 | } |
314 | 314 | } |
315 | | - |
| 315 | + |
316 | 316 | /** |
317 | 317 | * Perform the action of this thingy |
318 | 318 | * @throws OAIError |
— | — | @@ -324,7 +324,7 @@ |
325 | 325 | } |
326 | 326 | $this->checkpoint(); |
327 | 327 | } |
328 | | - |
| 328 | + |
329 | 329 | /** |
330 | 330 | * Update our checkpoint timestamp with the date from the |
331 | 331 | * OAI header; this allows us to pick up from the correct |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | private function checkpoint() { |
336 | 336 | global $oaiSourceRepository; |
337 | 337 | $ts = $this->_page['oai_timestamp']; |
338 | | - |
| 338 | + |
339 | 339 | $dbw = wfGetDB( DB_MASTER ); |
340 | 340 | $dbw->replace( 'oaiharvest', |
341 | 341 | array( 'oh_repository' ), |
— | — | @@ -344,7 +344,7 @@ |
345 | 345 | ), |
346 | 346 | __METHOD__ ); |
347 | 347 | } |
348 | | - |
| 348 | + |
349 | 349 | /** |
350 | 350 | * Perform an edit from the update data |
351 | 351 | * @throws OAIError |
— | — | @@ -357,21 +357,21 @@ |
358 | 358 | $this->getArticleId(), |
359 | 359 | $this->_page['title'] ) ); |
360 | 360 | } |
361 | | - |
| 361 | + |
362 | 362 | $id = 0; |
363 | 363 | foreach( $this->_page['revisions'] as $revision ) { |
364 | 364 | $id = $this->applyRevision( $revision ); |
365 | 365 | } |
366 | | - |
| 366 | + |
367 | 367 | RefreshLinks::fixLinksFromArticle( $id ); |
368 | | - |
| 368 | + |
369 | 369 | if( isset( $this->_page['uploads'] ) ) { |
370 | 370 | foreach( $this->_page['uploads'] as $upload ) { |
371 | 371 | $this->applyUpload( $upload ); |
372 | 372 | } |
373 | 373 | } |
374 | 374 | } |
375 | | - |
| 375 | + |
376 | 376 | /** |
377 | 377 | * Apply a revision update. |
378 | 378 | * @param array $data |
— | — | @@ -380,10 +380,10 @@ |
381 | 381 | $title = $this->getTitle(); |
382 | 382 | $pageId = $this->getArticleId(); |
383 | 383 | $timestamp = $this->getTimestamp( $data['timestamp'] ); |
384 | | - |
| 384 | + |
385 | 385 | $dbw = wfGetDB( DB_WRITE ); |
386 | 386 | $dbw->begin(); |
387 | | - |
| 387 | + |
388 | 388 | if( $data['id'] ) { |
389 | 389 | $conflictingRevision = Revision::newFromId( $data['id'] ); |
390 | 390 | if( $conflictingRevision ) { |
— | — | @@ -392,10 +392,10 @@ |
393 | 393 | return; |
394 | 394 | } |
395 | 395 | } |
396 | | - |
| 396 | + |
397 | 397 | // Take a look... |
398 | 398 | $article = $this->prepareArticle( $dbw, $pageId, $title ); |
399 | | - |
| 399 | + |
400 | 400 | // Insert a revision |
401 | 401 | $revision = new Revision( array( |
402 | 402 | 'id' => isset( $data['id'] ) ? intval( $data['id'] ) : null, |
— | — | @@ -411,13 +411,13 @@ |
412 | 412 | ) ); |
413 | 413 | $revId = $revision->insertOn( $dbw ); |
414 | 414 | echo "UPDATING to rev $revId\n"; |
415 | | - |
| 415 | + |
416 | 416 | // Update the page record |
417 | 417 | $article->updateRevisionOn( $dbw, $revision ); |
418 | | - |
| 418 | + |
419 | 419 | $dbw->commit(); |
420 | 420 | } |
421 | | - |
| 421 | + |
422 | 422 | /** |
423 | 423 | * @param int $pageId |
424 | 424 | * @param Title $title |
— | — | @@ -425,18 +425,18 @@ |
426 | 426 | */ |
427 | 427 | function prepareArticle( $db, $pageId, $title ) { |
428 | 428 | $fname = 'OAIUpdateRecord::prepareArticle'; |
429 | | - |
| 429 | + |
430 | 430 | $article = new Article( $title ); |
431 | 431 | $foundId = $article->getId(); |
432 | | - |
| 432 | + |
433 | 433 | if( $foundId == $pageId ) { |
434 | 434 | return $article; |
435 | 435 | } |
436 | | - |
| 436 | + |
437 | 437 | if( $foundId != 0 ) { |
438 | 438 | $this->hideConflictingPage( $db, $foundId, $title ); |
439 | 439 | } |
440 | | - |
| 440 | + |
441 | 441 | // Check to see if the page exists under a different title |
442 | 442 | $foundTitle = Title::newFromId( $pageId ); |
443 | 443 | if( $foundTitle ) { |
— | — | @@ -470,7 +470,7 @@ |
471 | 471 | $title->resetArticleID( -1 ); |
472 | 472 | return new Article( $title ); |
473 | 473 | } |
474 | | - |
| 474 | + |
475 | 475 | /** |
476 | 476 | * Rename a conflicting page record |
477 | 477 | * @param Database $db |
— | — | @@ -485,7 +485,7 @@ |
486 | 486 | array( 'page_id' => $existing ), |
487 | 487 | 'OAIUpdateRecord::hideConflictingPage' ); |
488 | 488 | } |
489 | | - |
| 489 | + |
490 | 490 | /** |
491 | 491 | * Update an image record |
492 | 492 | * @param array $upload |
— | — | @@ -493,7 +493,7 @@ |
494 | 494 | */ |
495 | 495 | function applyUpload( $upload ) { |
496 | 496 | $fname = 'OAIUpdateRecord::applyUpload'; |
497 | | - |
| 497 | + |
498 | 498 | # FIXME: validate these files... |
499 | 499 | if( strpos( $upload['filename'], '/' ) !== false |
500 | 500 | || strpos( $upload['filename'], '\\' ) !== false |
— | — | @@ -501,7 +501,7 @@ |
502 | 502 | || $upload['filename'] !== trim( $upload['filename'] ) ) { |
503 | 503 | throw new OAIError( 'Invalid filename "' . $upload['filename'] . '"' ); |
504 | 504 | } |
505 | | - |
| 505 | + |
506 | 506 | $dbw = wfGetDB( DB_MASTER ); |
507 | 507 | $data = array( |
508 | 508 | 'img_name' => $upload['filename'], |
— | — | @@ -513,15 +513,15 @@ |
514 | 514 | : strval( $upload['contributor']['ip'] ), |
515 | 515 | 'img_timestamp' => $dbw->timestamp( $this->getTimestamp( $upload['timestamp'] ) ), |
516 | 516 | 'img_metadata' => serialize( array() ) ); |
517 | | - |
| 517 | + |
518 | 518 | $dbw->begin(); |
519 | 519 | echo "REPLACING image row\n"; |
520 | 520 | $dbw->replace( 'image', array( 'img_name' ), $data, $fname ); |
521 | 521 | $dbw->commit(); |
522 | | - |
| 522 | + |
523 | 523 | $this->downloadUpload( $upload ); |
524 | 524 | } |
525 | | - |
| 525 | + |
526 | 526 | /** |
527 | 527 | * Fetch a file to go with an updated image record |
528 | 528 | * $param array $upload update info data |
— | — | @@ -534,7 +534,7 @@ |
535 | 535 | $upload['src'] . "'.\n"; |
536 | 536 | return; |
537 | 537 | } |
538 | | - |
| 538 | + |
539 | 539 | # We assume the filename has already been validated by code above us. |
540 | 540 | echo "File updating temporarily broken on 1.11, sorry!\n"; |
541 | 541 | return; |
— | — | @@ -546,20 +546,20 @@ |
547 | 547 | echo "Local file $filename matches; skipping download.\n"; |
548 | 548 | return; |
549 | 549 | } |
550 | | - |
| 550 | + |
551 | 551 | if( !preg_match( '!^http://!', $upload['src'] ) ) |
552 | 552 | throw new OAIError( 'Invalid image source URL "' . $upload['src'] . "'." ); |
553 | | - |
| 553 | + |
554 | 554 | $input = fopen( $upload['src'], 'rb' ); |
555 | 555 | if( !$input ) { |
556 | 556 | unlink( $filename ); |
557 | 557 | throw new OAIError( 'Could not fetch image source URL "' . $upload['src'] . "'." ); |
558 | 558 | } |
559 | | - |
| 559 | + |
560 | 560 | if( file_exists( $filename ) ) { |
561 | 561 | unlink( $filename ); |
562 | 562 | } |
563 | | - wfMkdirParents( dirname( $filename ) ); |
| 563 | + wfMkdirParents( dirname( $filename ), null, __METHOD__ ); |
564 | 564 | if( !( $output = fopen( $filename, 'xb' ) ) ) { |
565 | 565 | throw new OAIError( 'Could not create local image file "' . $filename . '" for writing.' ); |
566 | 566 | } |
— | — | @@ -572,33 +572,33 @@ |
573 | 573 | } |
574 | 574 | fclose( $input ); |
575 | 575 | fclose( $output ); |
576 | | - |
| 576 | + |
577 | 577 | touch( $filename, $timestamp ); |
578 | 578 | echo " done.\n"; |
579 | 579 | } |
580 | | - |
| 580 | + |
581 | 581 | /** |
582 | 582 | * Delete the page record. |
583 | 583 | */ |
584 | 584 | function doDelete() { |
585 | 585 | $dbw = wfGetDB( DB_MASTER ); |
586 | 586 | $dbw->begin(); |
587 | | - |
| 587 | + |
588 | 588 | $title = Title::newFromId( $this->getArticleId() ); |
589 | 589 | if( $title ) { |
590 | 590 | $article = new Article( $title ); |
591 | | - |
| 591 | + |
592 | 592 | echo "DELETING\n"; |
593 | 593 | $article->doDeleteArticle( 'deleted from parent repository' ); |
594 | 594 | } else { |
595 | 595 | echo "DELETING (not present)\n"; |
596 | 596 | } |
597 | | - |
| 597 | + |
598 | 598 | $dbw->commit(); |
599 | | - |
| 599 | + |
600 | 600 | return true; |
601 | 601 | } |
602 | | - |
| 602 | + |
603 | 603 | /** |
604 | 604 | * @param DomNode $node |
605 | 605 | */ |
— | — | @@ -607,7 +607,7 @@ |
608 | 608 | $record = new OAIUpdateRecord( $pageData ); |
609 | 609 | return $record; |
610 | 610 | } |
611 | | - |
| 611 | + |
612 | 612 | /** |
613 | 613 | * Collect page info out of an OAI record node containing export data. |
614 | 614 | * @param DOMNode $node |
— | — | @@ -637,7 +637,7 @@ |
638 | 638 | <minor> |
639 | 639 | */ |
640 | 640 | $header = oaiNextChild( $node, 'header' ); |
641 | | - |
| 641 | + |
642 | 642 | if( $header->getAttribute( 'status' ) == 'deleted' ) { |
643 | 643 | $pagedata = OAIUpdateRecord::grabDeletedPage( $header ); |
644 | 644 | } else { |
— | — | @@ -646,15 +646,15 @@ |
647 | 647 | $page = oaiNextChild( $mediawiki, 'page' ); |
648 | 648 | $pagedata = OAIUpdateRecord::grabPage( $page ); |
649 | 649 | } |
650 | | - |
| 650 | + |
651 | 651 | // We'll also need the OAI datestamp to ensure |
652 | 652 | // update stream continuity... |
653 | 653 | $datestamp = oaiNextChild( $header, 'datestamp' ); |
654 | 654 | $pagedata['oai_timestamp'] = wfTimestamp( TS_MW, $datestamp->textContent ); |
655 | | - |
| 655 | + |
656 | 656 | return $pagedata; |
657 | 657 | } |
658 | | - |
| 658 | + |
659 | 659 | /** |
660 | 660 | * Extract deleted page information from the OAI record |
661 | 661 | * @param DOMNode $header |
— | — | @@ -668,18 +668,18 @@ |
669 | 669 | </header> |
670 | 670 | */ |
671 | 671 | $identifier = oaiNextChild( $header, 'identifier' ); |
672 | | - |
| 672 | + |
673 | 673 | $ident = $identifier->textContent; |
674 | 674 | $bits = explode( ':', $ident ); |
675 | 675 | $id = intval( $bits[count( $bits ) - 1] ); |
676 | 676 | if( $id <= 0 ) |
677 | 677 | throw new OAIError( "Couldn't understand deleted page identifier '$ident'" ); |
678 | | - |
| 678 | + |
679 | 679 | return array( |
680 | 680 | 'id' => $id, |
681 | 681 | 'deleted' => true ); |
682 | 682 | } |
683 | | - |
| 683 | + |
684 | 684 | /** |
685 | 685 | * Extract non-deleted page information from the OAI record |
686 | 686 | * @param DOMNode $page |
— | — | @@ -709,7 +709,7 @@ |
710 | 710 | } |
711 | 711 | return $data; |
712 | 712 | } |
713 | | - |
| 713 | + |
714 | 714 | /** |
715 | 715 | * @param DOMNode $revision |
716 | 716 | */ |
— | — | @@ -732,7 +732,7 @@ |
733 | 733 | 'size', |
734 | 734 | 'contributor' => array( 'OAIUpdateRecord', 'grabContributor' ) ) ); |
735 | 735 | } |
736 | | - |
| 736 | + |
737 | 737 | function grabContributor( $node ) { |
738 | 738 | return oaiNodeMap( $node, array( |
739 | 739 | 'id', |
— | — | @@ -777,7 +777,7 @@ |
778 | 778 | } |
779 | 779 | } |
780 | 780 | } |
781 | | - |
| 781 | + |
782 | 782 | return $data; |
783 | 783 | } |
784 | 784 | |
— | — | @@ -795,7 +795,7 @@ |
796 | 796 | if( $node->nodeType == XML_ELEMENT_NODE |
797 | 797 | && ( is_null( $element ) || $node->nodeName == $element ) ) |
798 | 798 | return $node; |
799 | | - |
| 799 | + |
800 | 800 | return new OAIError( |
801 | 801 | is_null( $element ) |
802 | 802 | ? "No more elements" |
Index: trunk/extensions/Math/Math.body.php |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | if( $wgMathCheckFiles ) { |
55 | 55 | # Ensure that the temp and output directories are available before continuing... |
56 | 56 | if( !file_exists( $wgTmpDirectory ) ) { |
57 | | - if( !wfMkdirParents( $wgTmpDirectory ) ) { |
| 57 | + if( !wfMkdirParents( $wgTmpDirectory, null, __METHOD__ ) ) { |
58 | 58 | return $this->_error( 'math_bad_tmpdir' ); |
59 | 59 | } |
60 | 60 | } elseif( !is_dir( $wgTmpDirectory ) || !is_writable( $wgTmpDirectory ) ) { |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | $hashpath = $this->_getHashPath(); |
162 | 162 | if( !file_exists( $hashpath ) ) { |
163 | 163 | wfSuppressWarnings(); |
164 | | - $ret = wfMkdirParents( $hashpath, 0755 ); |
| 164 | + $ret = wfMkdirParents( $hashpath, 0755, __METHOD__ ); |
165 | 165 | wfRestoreWarnings(); |
166 | 166 | if( !$ret ) { |
167 | 167 | return $this->_error( 'math_bad_output' ); |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | __METHOD__ |
195 | 195 | ); |
196 | 196 | } |
197 | | - |
| 197 | + |
198 | 198 | // If we're replacing an older version of the image, make sure it's current. |
199 | 199 | global $wgUseSquid; |
200 | 200 | if ( $wgUseSquid ) { |
— | — | @@ -240,12 +240,12 @@ |
241 | 241 | $this->mathml = $rpage->math_mathml; |
242 | 242 | |
243 | 243 | $filename = $this->_getHashPath() . "/{$this->hash}.png"; |
244 | | - |
| 244 | + |
245 | 245 | if( !$wgMathCheckFiles ) { |
246 | 246 | // Short-circuit the file existence & migration checks |
247 | 247 | return true; |
248 | 248 | } |
249 | | - |
| 249 | + |
250 | 250 | if( file_exists( $filename ) ) { |
251 | 251 | if( filesize( $filename ) == 0 ) { |
252 | 252 | // Some horrible error corrupted stuff :( |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | |
264 | 264 | if( !file_exists( $hashpath ) ) { |
265 | 265 | wfSuppressWarnings(); |
266 | | - $ret = wfMkdirParents( $hashpath, 0755 ); |
| 266 | + $ret = wfMkdirParents( $hashpath, 0755, __METHOD__ ); |
267 | 267 | wfRestoreWarnings(); |
268 | 268 | if( !$ret ) { |
269 | 269 | return false; |
— | — | @@ -341,14 +341,14 @@ |
342 | 342 | $dir = $this->_getHashSubPath(); |
343 | 343 | return "$wgMathPath/$dir/{$this->hash}.png"; |
344 | 344 | } |
345 | | - |
| 345 | + |
346 | 346 | function _getHashPath() { |
347 | 347 | global $wgMathDirectory; |
348 | 348 | $path = $wgMathDirectory . '/' . $this->_getHashSubPath(); |
349 | 349 | wfDebug( "TeX: getHashPath, hash is: $this->hash, path is: $path\n" ); |
350 | 350 | return $path; |
351 | 351 | } |
352 | | - |
| 352 | + |
353 | 353 | function _getHashSubPath() { |
354 | 354 | return substr( $this->hash, 0, 1) |
355 | 355 | . '/' . substr( $this->hash, 1, 1 ) |
Index: trunk/extensions/TimedMediaHandler/TimedMediaThumbnail.php |
— | — | @@ -1,30 +1,30 @@ |
2 | | -<?php |
| 2 | +<?php |
3 | 3 | class TimedMediaThumbnail { |
4 | | - |
| 4 | + |
5 | 5 | static function get( $options ){ |
6 | 6 | global $wgFFmpegLocation, $wgOggThumbLocation; |
7 | 7 | |
8 | 8 | // Set up lodal pointer to file |
9 | 9 | $file = $options['file']; |
10 | 10 | if( !is_dir( dirname( $options['dstPath'] ) ) ){ |
11 | | - wfMkdirParents( dirname( $options['dstPath'] ) ); |
| 11 | + wfMkdirParents( dirname( $options['dstPath'] ), null, __METHOD__ ); |
12 | 12 | } |
13 | 13 | |
14 | | - wfDebug( "Creating video thumbnail at" . $options['dstPath'] . "\n" ); |
| 14 | + wfDebug( "Creating video thumbnail at" . $options['dstPath'] . "\n" ); |
15 | 15 | // Else try ffmpeg and return result: |
16 | 16 | return self::tryFfmpegThumb( $options ); |
17 | 17 | } |
18 | | - |
| 18 | + |
19 | 19 | static function tryFfmpegThumb( $options ){ |
20 | 20 | global $wgFFmpegLocation; |
21 | | - |
| 21 | + |
22 | 22 | $cmd = wfEscapeShellArg( $wgFFmpegLocation ) . |
23 | 23 | ' -i ' . wfEscapeShellArg( $options['file']->getPath() ); |
24 | | - // Set the output size if set in options: |
| 24 | + // Set the output size if set in options: |
25 | 25 | if( isset( $options['width'] ) && isset( $options['height'] ) ){ |
26 | 26 | $cmd.= ' -s '. intval( $options['width'] ) . 'x' . intval( $options['height'] ); |
27 | 27 | } |
28 | | - |
| 28 | + |
29 | 29 | $cmd.=' -ss ' . intval( self::getThumbTime( $options ) ) . |
30 | 30 | # MJPEG, that's the same as JPEG except it's supported by the windows build of ffmpeg |
31 | 31 | # No audio, one frame |
— | — | @@ -51,23 +51,23 @@ |
52 | 52 | return new MediaTransformError( 'thumbnail_error', $options['width'], $options['height'], implode( "\n", $lines ) ); |
53 | 53 | } |
54 | 54 | |
55 | | - static function getThumbTime( $options ){ |
| 55 | + static function getThumbTime( $options ){ |
56 | 56 | $length = $options['file']->getLength(); |
57 | 57 | $thumbtime = false; |
58 | | - |
| 58 | + |
59 | 59 | // If start time param isset use that for the thumb: |
60 | 60 | if( isset( $options['start'] ) ) { |
61 | 61 | $thumbtime = TimedMediaHandler::parseTimeString( $options['start'], $length ); |
62 | 62 | if( $thumbtime ) |
63 | | - return $thumbtime; |
| 63 | + return $thumbtime; |
64 | 64 | } |
65 | 65 | // else use thumbtime |
66 | 66 | if ( isset( $options['thumbtime'] ) ) { |
67 | 67 | $thumbtime = TimedMediaHandler::parseTimeString( $options['thumbtime'], $length ); |
68 | 68 | if( $thumbtime ) |
69 | | - return $thumbtime; |
70 | | - } |
| 69 | + return $thumbtime; |
| 70 | + } |
71 | 71 | // Seek to midpoint by default, it tends to be more interesting than the start |
72 | 72 | return $length / 2; |
73 | 73 | } |
74 | | -} |
\ No newline at end of file |
| 74 | +} |
Index: trunk/extensions/FundraiserPortal/rebuildButtons.php |
— | — | @@ -12,16 +12,16 @@ |
13 | 13 | echo "Usage:\n"; |
14 | 14 | echo " php extensions/FundraiserPortal/rebuildButtons.php [-o|Output to disk]\n"; |
15 | 15 | } else { |
16 | | - echo "Rebuilding button templates ...\n"; |
17 | | - |
| 16 | + echo "Rebuilding button templates ...\n"; |
| 17 | + |
18 | 18 | $builder = new DonateButton(); |
19 | 19 | $js = $builder->getJsOutput(); |
20 | 20 | |
21 | 21 | if ( isset( $options['o'] ) ) { |
22 | 22 | $lang = $wgLang->getCode(); |
23 | 23 | $outputDir = "$wgFundraiserPortalDirectory/wikipedia/$lang"; |
24 | | - if ( wfMkDirParents( $outputDir ) ) { |
25 | | - |
| 24 | + if ( wfMkDirParents( $outputDir, null, __METHOD__ ) ) { |
| 25 | + |
26 | 26 | $outputFile = "$outputDir/fundraiserportal.js"; |
27 | 27 | $ok = file_put_contents( $outputFile, $js ); |
28 | 28 | if ( !$ok ) { |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | } |
110 | 110 | |
111 | 111 | $outFile = $this->target . '/' . $filename; |
112 | | - wfMkdirParents( dirname( $outFile ) ); |
| 112 | + wfMkdirParents( dirname( $outFile ), null, __METHOD__ ); |
113 | 113 | $this->handles[$group->getId()] = fopen( $outFile, 'w' ); |
114 | 114 | fwrite( $this->handles[$group->getId()], $this->readHeader( $inFile ) ); |
115 | 115 | |
Index: trunk/extensions/Translate/ffs/Simple.php |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | } |
154 | 154 | $target = $targetDirectory . '/' . $filename; |
155 | 155 | |
156 | | - wfMkdirParents( dirname( $target ) ); |
| 156 | + wfMkdirParents( dirname( $target ), null, __METHOD__ ); |
157 | 157 | $handle = fopen( $target, 'wt' ); |
158 | 158 | |
159 | 159 | if ( $handle === false ) { |
Index: trunk/extensions/Translate/ffs/WikiExtension.php |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | $filename = $this->group->getMessageFile( '' ); |
103 | 103 | $target = $targetDirectory . '/' . $filename; |
104 | 104 | |
105 | | - wfMkdirParents( dirname( $target ) ); |
| 105 | + wfMkdirParents( dirname( $target ), null, __METHOD__ ); |
106 | 106 | $handle = fopen( $target, 'wt' ); |
107 | 107 | if ( $handle === false ) { |
108 | 108 | throw new MWException( "Unable to open target for writing" ); |
Index: trunk/extensions/PdfHandler/PdfHandler_body.php |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | $height, $dstPath, $page ); |
117 | 117 | } |
118 | 118 | |
119 | | - if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| 119 | + if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) { |
120 | 120 | return $this->doThumbError( $width, $height, 'thumbnail_dest_directory' ); |
121 | 121 | } |
122 | 122 | |
Index: trunk/extensions/EditMessages/EditMessages_body.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | function execute( $subpage = '' ) { |
11 | 11 | global $wgOut, $wgRequest; |
12 | | - |
| 12 | + |
13 | 13 | $this->setHeaders(); |
14 | 14 | |
15 | 15 | $messageName = $wgRequest->getVal( 'messageName' ); |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | ); |
123 | 123 | $dcRegex = '/[0-7]{1,3}|x[0-9A-Fa-f]{1,2}/'; |
124 | 124 | |
125 | | - wfMkdirParents( "$wgTmpDirectory/EditMessages" ); |
| 125 | + wfMkdirParents( "$wgTmpDirectory/EditMessages", null, __METHOD__ ); |
126 | 126 | $out = ''; |
127 | 127 | foreach ( $originalMsgs as $lang => $origValue ) { |
128 | 128 | if ( !isset( $newMsgs[$lang] ) ) { |
Index: trunk/extensions/WikiAtHome/ApiWikiAtHome.php |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | if( !$status->isGood() ){ |
155 | 155 | return $this->dieUsageMsg( array('code'=>'fileerror', 'info'=>'Could Not Move The Uploaded File') ); |
156 | 156 | }*/ |
157 | | - wfMkdirParents( $thumbPath ); |
| 157 | + wfMkdirParents( $thumbPath, null, __METHOD__ ); |
158 | 158 | if( !move_uploaded_file($uploadedJobFile, $destTarget) ){ |
159 | 159 | return $this->dieUsage( 'Could Not Move The Uploaded File', 'fileerror' ); |
160 | 160 | } |
Index: trunk/extensions/WikiAtHome/NonFreeVideoHandler.php |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | # Seek to midpoint by default, it tends to be more interesting than the start |
160 | 160 | $thumbTime = $length / 2; |
161 | 161 | } |
162 | | - wfMkdirParents( dirname( $dstPath ) ); |
| 162 | + wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ); |
163 | 163 | if(!is_file($dstPath)){ |
164 | 164 | $cmd = wfEscapeShellArg( $wgFFmpegLocation ) . |
165 | 165 | ' -ss ' . intval( $thumbTime ) . ' ' . |
Index: trunk/extensions/WikiAtHome/internalCmdLineEncoder.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | $file = wfLocalFile( $fTitle ); |
62 | 62 | $thumbPath = $file->getThumbPath( $jobSet->set_encodekey ); |
63 | 63 | //make sure the directory is ready: |
64 | | - wfMkdirParents( $thumbPath ); |
| 64 | + wfMkdirParents( $thumbPath, null, __METHOD__ ); |
65 | 65 | |
66 | 66 | $destTarget = $thumbPath . '.ogg'; |
67 | 67 | //issue the encoding command |
Index: trunk/extensions/TrustedMath/TrustedMath_body.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | public function __construct( $text ) { |
38 | 38 | $this->text = $text; |
39 | 39 | } |
40 | | - |
| 40 | + |
41 | 41 | /** |
42 | 42 | * Get the base16 md5 hash of the equation |
43 | 43 | * @return string Base 16 hash of the equation |
— | — | @@ -49,13 +49,13 @@ |
50 | 50 | } |
51 | 51 | /** |
52 | 52 | * Get the two level relative hash path of the equation |
53 | | - * @return string |
| 53 | + * @return string |
54 | 54 | */ |
55 | 55 | protected function getHashPath() { |
56 | 56 | $hash = $this->getHash(); |
57 | 57 | return $hash{0} . '/' . $hash{0} . $hash{1}; |
58 | 58 | } |
59 | | - |
| 59 | + |
60 | 60 | /** |
61 | 61 | * Get the LaTeX equation text |
62 | 62 | * @return string |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | public function getText() { |
65 | 65 | return $this->text; |
66 | 66 | } |
67 | | - |
| 67 | + |
68 | 68 | /** |
69 | 69 | * Set the path to the latex and dvipng renders |
70 | 70 | * @param string $latex |
— | — | @@ -87,14 +87,14 @@ |
88 | 88 | public function setEnvironment( $environ ) { |
89 | 89 | $this->environ = $environ; |
90 | 90 | } |
91 | | - |
| 91 | + |
92 | 92 | /** |
93 | | - * Render the LaTeX equation as PNG and store it into |
| 93 | + * Render the LaTeX equation as PNG and store it into |
94 | 94 | * $wgTrustedMathDirectory under a two level hash path. Will not re-render |
95 | 95 | * if the file already exists |
96 | | - * |
| 96 | + * |
97 | 97 | * @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 |
99 | 99 | * the rendered equation on success. |
100 | 100 | */ |
101 | 101 | public function render( $force = false ) { |
— | — | @@ -102,54 +102,54 @@ |
103 | 103 | $hash = $this->getHash(); |
104 | 104 | $hashPath = $this->getHashPath(); |
105 | 105 | $filePath = "{$this->dir}/$hashPath/$hash.png"; |
106 | | - |
| 106 | + |
107 | 107 | // Check equation existence |
108 | | - if ( !$force && file_exists( $filePath ) && |
| 108 | + if ( !$force && file_exists( $filePath ) && |
109 | 109 | filesize( $filePath ) > 0 ) { |
110 | | - return Status::newGood( "$hashPath/$hash.png" ); |
| 110 | + return Status::newGood( "$hashPath/$hash.png" ); |
111 | 111 | } |
112 | | - |
| 112 | + |
113 | 113 | // Create the hash path |
114 | 114 | wfSuppressWarnings(); |
115 | | - if ( !wfMkDirParents( "{$this->dir}/$hashPath" ) ) { |
| 115 | + if ( !wfMkDirParents( "{$this->dir}/$hashPath", null, __METHOD__ ) ) { |
116 | 116 | wfRestoreWarnings(); |
117 | 117 | return Status::newFatal( 'trustedmath-path-error', $hashPath ); |
118 | 118 | } |
119 | 119 | wfRestoreWarnings(); |
120 | | - |
| 120 | + |
121 | 121 | // Create a random file, wrap the equation in LaTeX and store it |
122 | 122 | $file = "{$this->dir}/$hash" . wfBaseConvert( mt_rand(), 10, 36 ); |
123 | 123 | file_put_contents( "$file.tex", self::wrapEquation( $this->getText() ) ); |
124 | | - |
| 124 | + |
125 | 125 | $retval = null; |
126 | | - |
| 126 | + |
127 | 127 | // 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', |
130 | 130 | $this->dir, "$file.tex" ) . ' 2>&1', $retval, $this->environ ); |
131 | 131 | if ( !file_exists( "$file.dvi" ) ) { |
132 | 132 | // Something went wrong, return the output of the latex command |
133 | 133 | $this->cleanup( $file ); |
134 | | - return Status::newFatal( 'trustedmath-convert-error', |
| 134 | + return Status::newFatal( 'trustedmath-convert-error', |
135 | 135 | $this->latex, $output ); |
136 | 136 | } |
137 | | - |
| 137 | + |
138 | 138 | // 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 ' . |
141 | 141 | wfEscapeShellArg( $filePath, "$file.dvi" ), $retval, $this->environ ); |
142 | 142 | if ( !file_exists( $filePath ) ) { |
143 | 143 | // Something went wrong, return the output of the dvipng command |
144 | 144 | $this->cleanup( $file ); |
145 | | - return Status::newFatal( 'trustedmath-convert-error', |
| 145 | + return Status::newFatal( 'trustedmath-convert-error', |
146 | 146 | $this->dvipng, $output ); |
147 | 147 | } |
148 | | - |
| 148 | + |
149 | 149 | // Everything ok, return the path |
150 | 150 | $this->cleanup( $file ); |
151 | 151 | return Status::newGood( "$hashPath/$hash.png" ); |
152 | 152 | } |
153 | | - |
| 153 | + |
154 | 154 | /** |
155 | 155 | * Wrap a LaTeX equation in the minimum amount required to render it |
156 | 156 | * @param string $equation |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | return implode( "\n", array( |
161 | 161 | '\documentclass{article}', |
162 | 162 | '\pagestyle{empty}', |
163 | | - '\usepackage{amsmath}', |
| 163 | + '\usepackage{amsmath}', |
164 | 164 | '\begin{document}', |
165 | 165 | '\begin{equation*}', |
166 | 166 | trim( $equation ), |
— | — | @@ -167,22 +167,22 @@ |
168 | 168 | '\end{document}', |
169 | 169 | ) ); |
170 | 170 | } |
171 | | - |
| 171 | + |
172 | 172 | /** |
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 |
174 | 174 | * 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 |
176 | 176 | */ |
177 | 177 | protected static function cleanup( $file ) { |
178 | 178 | $dir = dirname( $file ); |
179 | | - $iter = new RegexIterator( new DirectoryIterator( $dir ), |
| 179 | + $iter = new RegexIterator( new DirectoryIterator( $dir ), |
180 | 180 | '#^' . preg_quote( basename( $file ) ) . '\..*$#' ); |
181 | | - |
| 181 | + |
182 | 182 | wfSuppressWarnings(); |
183 | 183 | foreach ( $iter as $file ) { |
184 | 184 | unlink( "$dir/$file" ); |
185 | 185 | } |
186 | 186 | wfRestoreWarnings(); |
187 | 187 | } |
188 | | - |
| 188 | + |
189 | 189 | } |
Index: trunk/extensions/WebStore/store.php |
— | — | @@ -37,11 +37,11 @@ |
38 | 38 | $this->cleanupTemp( $now ); |
39 | 39 | |
40 | 40 | $timestamp = gmdate( self::$tempDirFormat, $now ); |
41 | | - if ( !wfMkdirParents( "{$this->tmpDir}/$timestamp" ) ) { |
| 41 | + if ( !wfMkdirParents( "{$this->tmpDir}/$timestamp", null, __METHOD__ ) ) { |
42 | 42 | $this->error( 500, 'webstore_dest_mkdir' ); |
43 | 43 | return false; |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | // Get the extension of the upload, needs to be preserved for type detection |
47 | 47 | $name = $wgRequest->getFileName( 'file' ); |
48 | 48 | $n = strrpos( $name, '.' ); |
Index: trunk/extensions/WebStore/inplace-scaler.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | break; |
24 | 24 | } |
25 | 25 | } |
26 | | - |
| 26 | + |
27 | 27 | if ( !$allowed ) { |
28 | 28 | $this->htmlError( 403, 'inplace_access_denied' ); |
29 | 29 | return false; |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | |
50 | 50 | $tempDir = $this->tmpDir . '/' . gmdate( self::$tempDirFormat ); |
51 | 51 | if ( !is_dir( $tempDir ) ) { |
52 | | - if ( !wfMkdirParents( $tempDir ) ) { |
| 52 | + if ( !wfMkdirParents( $tempDir, null, __METHOD__ ) ) { |
53 | 53 | $this->htmlError( 500, 'inplace_scaler_no_temp' ); |
54 | 54 | return false; |
55 | 55 | } |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | |
61 | 61 | $params = $_REQUEST; |
62 | 62 | unset( $params['file'] ); |
63 | | - if ( get_magic_quotes_gpc() ) { |
| 63 | + if ( get_magic_quotes_gpc() ) { |
64 | 64 | $params = array_map( 'stripslashes', $params ); |
65 | 65 | } |
66 | 66 | |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
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, |
131 | 131 | // which would leave a corrupt image file permanently on disk. Prevent this from |
132 | 132 | // happening. |
133 | 133 | ini_set( 'display_errors', false ); |
Index: trunk/extensions/WebStore/WebStoreCommon.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | } |
43 | 43 | $this->windows = wfIsWindows(); |
44 | 44 | |
45 | | - |
| 45 | + |
46 | 46 | } |
47 | 47 | |
48 | 48 | function setErrorHandler() { |
— | — | @@ -184,7 +184,7 @@ |
185 | 185 | $success = true; |
186 | 186 | do { |
187 | 187 | // Create destination directory |
188 | | - if ( !wfMkdirParents( dirname( $dstPath ) ) ) { |
| 188 | + if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) { |
189 | 189 | $this->errors[] = new WebStoreError( 'webstore_dest_mkdir', $dstPath ); |
190 | 190 | $success = false; |
191 | 191 | break; |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | do { |
255 | 255 | // Create destination directory |
256 | 256 | $dstDir = dirname( $dstPath ); |
257 | | - if ( !wfMkdirParents( $dstDir ) ) { |
| 257 | + if ( !wfMkdirParents( $dstDir, null, __METHOD__ ) ) { |
258 | 258 | $this->errors[] = new WebStoreError( 'webstore_dest_mkdir', $dstDir ); |
259 | 259 | $success = false; |
260 | 260 | break; |
Index: trunk/extensions/WebStore/publish.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
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 |
6 | 6 | * if there was one. |
7 | 7 | */ |
8 | 8 | |
— | — | @@ -53,16 +53,16 @@ |
54 | 54 | $archiveRel = $wgRequest->getVal( 'archive' ); |
55 | 55 | |
56 | 56 | // Check for directory traversal |
57 | | - if ( !$this->validateFilename( $srcRel ) || |
58 | | - !$this->validateFilename( $dstRel ) || |
| 57 | + if ( !$this->validateFilename( $srcRel ) || |
| 58 | + !$this->validateFilename( $dstRel ) || |
59 | 59 | !$this->validateFilename( $archiveRel ) ) |
60 | 60 | { |
61 | 61 | $this->error( 400, 'webstore_path_invalid' ); |
62 | 62 | return false; |
63 | 63 | } |
64 | 64 | |
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 |
67 | 67 | // data loss. |
68 | 68 | if ( !preg_match( '!^archive|[a-zA-Z0-9]/!', $dstRel ) ) { |
69 | 69 | $this->error( 400, 'webstore_path_invalid' ); |
— | — | @@ -70,8 +70,8 @@ |
71 | 71 | } |
72 | 72 | |
73 | 73 | // 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' ) |
76 | 76 | { |
77 | 77 | $this->error( 400, 'webstore_path_invalid' ); |
78 | 78 | return false; |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | do { |
140 | 140 | // Create archive directory |
141 | 141 | $archiveDir = dirname( $archivePath ); |
142 | | - if ( !wfMkdirParents( $archiveDir ) ) { |
| 142 | + if ( !wfMkdirParents( $archiveDir, null, __METHOD__ ) ) { |
143 | 143 | $this->errors[] = new WebStoreError( 'webstore_archive_mkdir', $archiveDir ); |
144 | 144 | $success = false; |
145 | 145 | break; |
— | — | @@ -171,11 +171,11 @@ |
172 | 172 | break; |
173 | 173 | } |
174 | 174 | |
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 |
176 | 176 | // current location for now so that webserving continues to work. |
177 | 177 | // 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 |
180 | 180 | // the archive, makes this a dangerous option. |
181 | 181 | // |
182 | 182 | // NO_LOCK option because we already have the lock |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | $success = $this->copyPath( $srcPath, $dstPath, self::NO_LOCK | self::OVERWRITE ); |
201 | 201 | } |
202 | 202 | } while (false); |
203 | | - |
| 203 | + |
204 | 204 | // Close the lock files |
205 | 205 | if ( $archiveLockFile ) { |
206 | 206 | if ( !$this->closeAndDelete( $archiveLockFile, $archiveLockPath ) ) { |
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php |
— | — | @@ -332,7 +332,7 @@ |
333 | 333 | $height, $dstPath, $page ); |
334 | 334 | } |
335 | 335 | |
336 | | - if ( !wfMkdirParents( dirname( $dstPath ) ) ) |
| 336 | + if ( !wfMkdirParents( dirname( $dstPath ), null, __METHOD__ ) ) |
337 | 337 | return $this->doThumbError( $params, 'thumbnail_dest_directory' ); |
338 | 338 | |
339 | 339 | if ( $wgTiffUseVips ) { |
Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php |
— | — | @@ -4,6 +4,19 @@ |
5 | 5 | } |
6 | 6 | |
7 | 7 | 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 | + |
8 | 21 | public function __construct() { |
9 | 22 | parent::__construct( 'AbuseLog', 'abusefilter-log' ); |
10 | 23 | } |
— | — | @@ -315,16 +328,25 @@ |
316 | 329 | $wgOut->addHTML( $output ); |
317 | 330 | } |
318 | 331 | |
| 332 | + /** |
| 333 | + * @return bool |
| 334 | + */ |
319 | 335 | static function canSeeDetails() { |
320 | 336 | global $wgUser; |
321 | 337 | return $wgUser->isAllowed( 'abusefilter-log-detail' ); |
322 | 338 | } |
323 | 339 | |
| 340 | + /** |
| 341 | + * @return bool |
| 342 | + */ |
324 | 343 | static function canSeePrivate() { |
325 | 344 | global $wgUser; |
326 | 345 | return $wgUser->isAllowed( 'abusefilter-private' ); |
327 | 346 | } |
328 | 347 | |
| 348 | + /** |
| 349 | + * @return bool |
| 350 | + */ |
329 | 351 | static function canSeeHidden() { |
330 | 352 | global $wgUser; |
331 | 353 | return $wgUser->isAllowed( 'abusefilter-hidden-log' ); |
— | — | @@ -463,6 +485,10 @@ |
464 | 486 | return $li ? Xml::tags( 'li', null, $description ) : $description; |
465 | 487 | } |
466 | 488 | |
| 489 | + /** |
| 490 | + * @param $db DatabaseBase |
| 491 | + * @return string |
| 492 | + */ |
467 | 493 | public static function getNotDeletedCond( $db ) { |
468 | 494 | $deletedZeroCond = $db->makeList( |
469 | 495 | array( 'afl_deleted' => 0 ), LIST_AND ); |
Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | } |
52 | 52 | $this->period = $period; |
53 | 53 | $this->dScale = 20; |
54 | | - |
| 54 | + |
55 | 55 | $this->now = time(); // one time for whole request |
56 | 56 | |
57 | 57 | $this->showForm(); |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | } |
68 | 68 | $this->showGraphs(); |
69 | 69 | } |
70 | | - |
| 70 | + |
71 | 71 | protected function showTable() { |
72 | 72 | global $wgOut; |
73 | 73 | # Show latest month of results |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | ); |
83 | 83 | } |
84 | 84 | } |
85 | | - |
| 85 | + |
86 | 86 | protected function showForm() { |
87 | 87 | global $wgOut, $wgScript; |
88 | 88 | $form = Xml::openElement( 'form', array( 'name' => 'reviewedpages', |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | $form .= "</fieldset></form>\n"; |
98 | 98 | $wgOut->addHTML( $form ); |
99 | 99 | } |
100 | | - |
| 100 | + |
101 | 101 | /** |
102 | 102 | * Get a selector of time period options |
103 | 103 | * @param int $selected, selected level |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | $s .= Xml::closeElement('select')."\n"; |
113 | 113 | return $s; |
114 | 114 | } |
115 | | - |
| 115 | + |
116 | 116 | protected function showGraphs() { |
117 | 117 | global $wgOut; |
118 | 118 | $data = false; |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | } |
159 | 159 | $html .= "<h3>" . wfMsgHtml("readerfeedback-$tag") . "$viewLink</h3>\n" . |
160 | 160 | 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) ) . |
162 | 162 | Xml::closeElement( 'img' ) . |
163 | 163 | Xml::closeElement( 'div' ) . "\n" . |
164 | 164 | wfMsgExt('ratinghistory-graph-scale', 'parse', $this->dScale ) . "\n"; |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | } |
202 | 202 | $wgOut->addHTML( $html ); |
203 | 203 | } |
204 | | - |
| 204 | + |
205 | 205 | /** |
206 | 206 | * Generate an HTML table for this tag |
207 | 207 | * @param string $tag |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | public function makeHTMLTable( $tag, $filePath ) { |
212 | 212 | $dir = dirname($filePath); |
213 | 213 | // Make sure directory exists |
214 | | - if( !is_dir($dir) && !wfMkdirParents( $dir, 0777 ) ) { |
| 214 | + if( !is_dir($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) { |
215 | 215 | return false; |
216 | 216 | } |
217 | 217 | // Define the data using the DB rows |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | fclose( $fp ); |
252 | 252 | return $chart; |
253 | 253 | } |
254 | | - |
| 254 | + |
255 | 255 | /** |
256 | 256 | * Generate a graph for this tag |
257 | 257 | * @param string $tag |
— | — | @@ -269,7 +269,7 @@ |
270 | 270 | // Set file path |
271 | 271 | $dir = dirname($filePath); |
272 | 272 | // Make sure directory exists |
273 | | - if( !file_exists($dir) && !wfMkdirParents( $dir, 0777 ) ) { |
| 273 | + if( !file_exists($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) { |
274 | 274 | throw new MWException( 'Could not create file directory!' ); |
275 | 275 | } |
276 | 276 | $plot->SetOutputFile( $filePath ); |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | $plot->DrawGraph(); |
352 | 352 | return true; |
353 | 353 | } |
354 | | - |
| 354 | + |
355 | 355 | /** |
356 | 356 | * Generate a graph for this tag |
357 | 357 | * @param string $tag |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | // Set file path |
368 | 368 | $dir = dirname($filePath); |
369 | 369 | // Make sure directory exists |
370 | | - if( !file_exists($dir) && !wfMkdirParents( $dir, 0777 ) ) { |
| 370 | + if( !file_exists($dir) && !wfMkdirParents( $dir, 0777, __METHOD__ ) ) { |
371 | 371 | throw new MWException( 'Could not create file directory!' ); |
372 | 372 | } |
373 | 373 | // Set some parameters |
— | — | @@ -458,7 +458,7 @@ |
459 | 459 | $plot->styleTagsY = 'font-family: sans-serif; font-size: 11pt;'; |
460 | 460 | $plot->format['dave'] = array( 'style' => 'stroke:blue; stroke-width:1;' ); |
461 | 461 | $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;' ); |
463 | 463 | #'attributes' => "marker-end='url(#circle)'"); |
464 | 464 | $pageText = $wgContLang->truncate( $this->page->getPrefixedText(), 65 ); |
465 | 465 | $plot->title = wfMsgExt('ratinghistory-graph',array('parsemag','content'), |
— | — | @@ -467,7 +467,7 @@ |
468 | 468 | $plot->backgroundStyle = 'fill:#F0F0F0;'; |
469 | 469 | // extra code for markers |
470 | 470 | // FIXME: http://studio.imagemagick.org/pipermail/magick-bugs/2003-January/001038.html |
471 | | - /* $plot->extraSVG = |
| 471 | + /* $plot->extraSVG = |
472 | 472 | '<defs> |
473 | 473 | <marker id="circle" style="stroke:red; stroke-width:0; fill:red;" |
474 | 474 | viewBox="0 0 10 10" refX="5" refY="7" orient="0" |
— | — | @@ -508,7 +508,7 @@ |
509 | 509 | } |
510 | 510 | return true; |
511 | 511 | } |
512 | | - |
| 512 | + |
513 | 513 | protected function doQuery( $tag ) { |
514 | 514 | // Set cutoff time for period |
515 | 515 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | $cutoff = $dbr->addQuotes( wfTimestamp( TS_MW, $cutoff_unixtime ) ); |
519 | 519 | $res = $dbr->select( 'reader_feedback_history', |
520 | 520 | array( 'rfh_total', 'rfh_count', 'rfh_date' ), |
521 | | - array( 'rfh_page_id' => $this->page->getArticleId(), |
| 521 | + array( 'rfh_page_id' => $this->page->getArticleId(), |
522 | 522 | 'rfh_tag' => $tag, |
523 | 523 | "rfh_date >= {$cutoff}"), |
524 | 524 | __METHOD__, |
— | — | @@ -543,7 +543,7 @@ |
544 | 544 | } |
545 | 545 | return array($res,$ave,$maxC,$days); |
546 | 546 | } |
547 | | - |
| 547 | + |
548 | 548 | /** |
549 | 549 | * Get the path to where the corresponding graph file should be |
550 | 550 | * @param string $tag |
— | — | @@ -555,7 +555,7 @@ |
556 | 556 | $rel = $this->getRelPath( $tag, $ext ); |
557 | 557 | return "{$wgUploadDirectory}/graphs/{$rel}"; |
558 | 558 | } |
559 | | - |
| 559 | + |
560 | 560 | /** |
561 | 561 | * Get the url to where the corresponding graph file should be |
562 | 562 | * @param string $tag |
— | — | @@ -567,7 +567,7 @@ |
568 | 568 | $rel = $this->getRelPath( $tag, $ext ); |
569 | 569 | return "{$wgUploadPath}/graphs/{$rel}"; |
570 | 570 | } |
571 | | - |
| 571 | + |
572 | 572 | public function getRelPath( $tag, $ext = '' ) { |
573 | 573 | $ext = $ext ? $ext : self::getCachedFileExtension(); |
574 | 574 | $pageId = $this->page->getArticleId(); |
— | — | @@ -577,7 +577,7 @@ |
578 | 578 | } |
579 | 579 | return "{$pageId}/{$tag}/l{$this->period}d.{$ext}"; |
580 | 580 | } |
581 | | - |
| 581 | + |
582 | 582 | public static function getCachedFileExtension() { |
583 | 583 | global $wgSvgGraphDir, $wgPHPlotDir; |
584 | 584 | if( $wgSvgGraphDir || $wgPHPlotDir ) { |
— | — | @@ -587,7 +587,7 @@ |
588 | 588 | } |
589 | 589 | return $ext; |
590 | 590 | } |
591 | | - |
| 591 | + |
592 | 592 | public static function getSourceFileExtension() { |
593 | 593 | global $wgSvgGraphDir, $wgPHPlotDir; |
594 | 594 | if( $wgSvgGraphDir ) { |
— | — | @@ -599,7 +599,7 @@ |
600 | 600 | } |
601 | 601 | return $ext; |
602 | 602 | } |
603 | | - |
| 603 | + |
604 | 604 | protected function getUserList() { |
605 | 605 | global $wgMemc; |
606 | 606 | if( $this->period > 93 ) { |
— | — | @@ -609,7 +609,7 @@ |
610 | 610 | // Check cache |
611 | 611 | if( !$this->doPurge ) { |
612 | 612 | $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 |
614 | 614 | // schema groups ratings by date for graphs. |
615 | 615 | $cache_cutoff = $this->now - ($this->now % 86400); |
616 | 616 | if( is_array($set) && count($set) == 2 ) { |
— | — | @@ -666,7 +666,7 @@ |
667 | 667 | $wgMemc->set( $key, array( $html, $this->now ), 24*3600 ); |
668 | 668 | return $html; |
669 | 669 | } |
670 | | - |
| 670 | + |
671 | 671 | public function purgePage() { |
672 | 672 | global $wgUploadDirectory; |
673 | 673 | foreach( ReaderFeedback::getFeedbackTags() as $tag => $weight ) { |
— | — | @@ -684,7 +684,7 @@ |
685 | 685 | } |
686 | 686 | return true; |
687 | 687 | } |
688 | | - |
| 688 | + |
689 | 689 | /** |
690 | 690 | * Check if a graph file is expired. Set $this->dScale. |
691 | 691 | * @param string $tag |
— | — | @@ -717,7 +717,7 @@ |
718 | 718 | # If there are new votes, graph is stale |
719 | 719 | return ( $file_unixtime < $tagTimestamp ); |
720 | 720 | } |
721 | | - |
| 721 | + |
722 | 722 | /** |
723 | 723 | * Get highest touch timestamp of the tags. This uses a tiny filesort. |
724 | 724 | * @param $page Title |
— | — | @@ -725,7 +725,7 @@ |
726 | 726 | */ |
727 | 727 | public static function getTouched( $page ) { |
728 | 728 | $dbr = wfGetDB( DB_SLAVE ); |
729 | | - $tagTimestamp = $dbr->selectField( 'reader_feedback_pages', |
| 729 | + $tagTimestamp = $dbr->selectField( 'reader_feedback_pages', |
730 | 730 | 'MAX(rfp_touched)', |
731 | 731 | array( 'rfp_page_id' => $page->getArticleId() ), |
732 | 732 | __METHOD__ ); |
Index: trunk/extensions/DumpHTML/dumpHTML.inc |
— | — | @@ -1180,7 +1180,7 @@ |
1181 | 1181 | |
1182 | 1182 | function mkdir( $dir ) { |
1183 | 1183 | //if ( wfIsWindows() ) { |
1184 | | - return wfMkdirParents( $dir, 0755 ); |
| 1184 | + return wfMkdirParents( $dir, 0755, __METHOD__ ); |
1185 | 1185 | /*} else { |
1186 | 1186 | $dir = escapeshellarg( $dir ); |
1187 | 1187 | `mkdir -p -- $dir`; |