Index: trunk/phase3/maintenance/checkSyntax.php |
— | — | @@ -101,7 +101,9 @@ |
102 | 102 | return; // process only this path |
103 | 103 | } elseif ( $this->hasOption( 'list-file' ) ) { |
104 | 104 | $file = $this->getOption( 'list-file' ); |
105 | | - $f = @fopen( $file, 'r' ); |
| 105 | + wfSuppressWarnings(); |
| 106 | + $f = fopen( $file, 'r' ); |
| 107 | + wfRestoreWarnings(); |
106 | 108 | if ( !$f ) { |
107 | 109 | $this->error( "Can't open file $file\n", true ); |
108 | 110 | } |
Index: trunk/phase3/maintenance/rebuildFileCache.php |
— | — | @@ -95,7 +95,9 @@ |
96 | 96 | ob_start( array( &$cache, 'saveToFileCache' ) ); // save on ob_end_clean() |
97 | 97 | $wgUseFileCache = false; // hack, we don't want $article fiddling with filecache |
98 | 98 | $article->view(); |
99 | | - @$wgOut->output(); // header notices |
| 99 | + wfSuppressWarnings(); // header notices |
| 100 | + $wgOut->output(); |
| 101 | + wfRestoreWarnings(); |
100 | 102 | $wgUseFileCache = true; |
101 | 103 | ob_end_clean(); // clear buffer |
102 | 104 | if ( $rebuilt ) |
Index: trunk/phase3/maintenance/updateSearchIndex.php |
— | — | @@ -55,11 +55,10 @@ |
56 | 56 | # We can safely delete the file when we're done though. |
57 | 57 | $start = file_get_contents( 'searchUpdate.pos' ); |
58 | 58 | unlink( 'searchUpdate.pos' ); |
| 59 | + } elseif( is_readable( $posFile ) ) { |
| 60 | + $start = file_get_contents( $posFile ); |
59 | 61 | } else { |
60 | | - $start = @file_get_contents( $posFile ); |
61 | | - if ( !$start ) { |
62 | | - $start = wfTimestamp( TS_MW, time() - 86400 ); |
63 | | - } |
| 62 | + $start = wfTimestamp( TS_MW, time() - 86400 ); |
64 | 63 | } |
65 | 64 | $lockTime = $this->getOption( 'l', 20 ); |
66 | 65 | |
Index: trunk/phase3/maintenance/updateSpecialPages.php |
— | — | @@ -65,7 +65,8 @@ |
66 | 66 | require_once( "$IP/includes/QueryPage.php" ); |
67 | 67 | |
68 | 68 | foreach ( $wgQueryPages as $page ) { |
69 | | - @list( $class, $special, $limit ) = $page; |
| 69 | + list( $class, $special ) = $page; |
| 70 | + $limit = isset( $page[2] ) ? $page[2] : null; |
70 | 71 | |
71 | 72 | # --list : just show the name of pages |
72 | 73 | if ( $this->hasOption( 'list' ) ) { |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -697,7 +697,9 @@ |
698 | 698 | if ( strpos( $file, $this->getName() ) !== false ) { |
699 | 699 | $url = $this->getThumbUrl( $file ); |
700 | 700 | $urls[] = $url; |
701 | | - @unlink( "$dir/$file" ); |
| 701 | + wfSuppressWarnings(); |
| 702 | + unlink( "$dir/$file" ); |
| 703 | + wfRestoreWarnings(); |
702 | 704 | } |
703 | 705 | } |
704 | 706 | |
Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -592,14 +592,18 @@ |
593 | 593 | $good = true; |
594 | 594 | if ( file_exists( $archivePath ) ) { |
595 | 595 | # A file with this content hash is already archived |
596 | | - if ( !@unlink( $srcPath ) ) { |
| 596 | + wfSuppressWarnings(); |
| 597 | + $good = unlink( $srcPath ); |
| 598 | + wfRestoreWarnings(); |
| 599 | + if ( !$good ) { |
597 | 600 | $status->error( 'filedeleteerror', $srcPath ); |
598 | | - $good = false; |
599 | 601 | } |
600 | 602 | } else{ |
601 | | - if ( !@rename( $srcPath, $archivePath ) ) { |
| 603 | + wfSuppressWarnings(); |
| 604 | + $good = rename( $srcPath, $archivePath ); |
| 605 | + wfRestoreWarnings(); |
| 606 | + if ( !$good ) { |
602 | 607 | $status->error( 'filerenameerror', $srcPath, $archivePath ); |
603 | | - $good = false; |
604 | 608 | } else { |
605 | 609 | $this->chmod( $archivePath ); |
606 | 610 | } |
Index: trunk/phase3/includes/filerepo/LocalRepo.php |
— | — | @@ -78,7 +78,10 @@ |
79 | 79 | } |
80 | 80 | if ( !$inuse ) { |
81 | 81 | wfDebug( __METHOD__ . ": deleting $key\n" ); |
82 | | - if ( !@unlink( $path ) ) { |
| 82 | + wfSuppressWarnings(); |
| 83 | + $unlink = unlink( $path ); |
| 84 | + wfRestoreWarnings(); |
| 85 | + if ( !$unlink ) { |
83 | 86 | $status->error( 'undelete-cleanup-error', $path ); |
84 | 87 | $status->failCount++; |
85 | 88 | } |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -98,11 +98,11 @@ |
99 | 99 | |
100 | 100 | // Info we can get from API... |
101 | 101 | public function getWidth( $page = 1 ) { |
102 | | - return intval( @$this->mInfo['width'] ); |
| 102 | + return isset( $this->mInfo['width'] ) ? intval( @$this->mInfo['width'] ) : 0; |
103 | 103 | } |
104 | 104 | |
105 | 105 | public function getHeight( $page = 1 ) { |
106 | | - return intval( @$this->mInfo['height'] ); |
| 106 | + return isset( $this->mInfo['height'] ) ? intval( @$this->mInfo['height'] ) : 0; |
107 | 107 | } |
108 | 108 | |
109 | 109 | public function getMetadata() { |
Index: trunk/phase3/includes/media/DjVu.php |
— | — | @@ -120,7 +120,9 @@ |
121 | 121 | // normaliseParams will inevitably give. |
122 | 122 | $xml = $image->getMetadata(); |
123 | 123 | if ( !$xml ) { |
124 | | - return new MediaTransformError( 'thumbnail_error', @$params['width'], @$params['height'], |
| 124 | + $width = isset( $params['width'] ) ? $params['width'] : 0; |
| 125 | + $height = isset( $params['height'] ) ? $params['height'] : 0; |
| 126 | + return new MediaTransformError( 'thumbnail_error', $width, $height, |
125 | 127 | wfMsg( 'djvu_no_xml' ) ); |
126 | 128 | } |
127 | 129 | |
Index: trunk/phase3/includes/templates/Userlogin.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | <p id="userloginlink"><?php $this->html('link') ?></p> |
38 | 38 | <?php $this->html('header'); /* pre-table point for form plugins... */ ?> |
39 | 39 | <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div> |
40 | | - <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> |
| 40 | + <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> |
41 | 41 | <table> |
42 | 42 | <tr> |
43 | 43 | <td class="mw-label"><label for='wpName1'><?php $this->msg('yourname') ?></label></td> |
— | — | @@ -148,8 +148,8 @@ |
149 | 149 | </td> |
150 | 150 | </tr> |
151 | 151 | </table> |
152 | | -<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> |
153 | | -<?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> |
| 152 | +<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> |
| 153 | +<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpLoginToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> |
154 | 154 | </form> |
155 | 155 | </div> |
156 | 156 | <div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div> |
— | — | @@ -191,7 +191,7 @@ |
192 | 192 | <h2><?php $this->msg('createaccount') ?></h2> |
193 | 193 | <p id="userloginlink"><?php $this->html('link') ?></p> |
194 | 194 | <?php $this->html('header'); /* pre-table point for form plugins... */ ?> |
195 | | - <?php if( @$this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> |
| 195 | + <?php if( $this->haveData( 'languages' ) ) { ?><div id="languagelinks"><p><?php $this->html( 'languages' ); ?></p></div><?php } ?> |
196 | 196 | <table> |
197 | 197 | <tr> |
198 | 198 | <td class="mw-label"><label for='wpName2'><?php $this->msg('yourname') ?></label></td> |
— | — | @@ -373,8 +373,8 @@ |
374 | 374 | </td> |
375 | 375 | </tr> |
376 | 376 | </table> |
377 | | -<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> |
378 | | -<?php if( @$this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> |
| 377 | +<?php if( $this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?> |
| 378 | +<?php if( $this->haveData( 'token' ) ) { ?><input type="hidden" name="wpCreateaccountToken" value="<?php $this->text( 'token' ); ?>" /><?php } ?> |
379 | 379 | </form> |
380 | 380 | </div> |
381 | 381 | <div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div> |