r43552 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43551‎ | r43552 | r43553 >
Date:11:40, 15 November 2008
Author:aaron
Status:deferred
Tags:
Comment:
* Make getCurrent() return something in last failure case
* Use more error suppression
* Remove unused var
Modified paths:
  • /trunk/extensions/Configure/Configure.handler-files.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.handler-files.php
@@ -33,14 +33,14 @@
3434 # maybe the first time the user use this extensions, do not override
3535 # anything
3636 return array();
37 - $cont = file_get_contents( $file );
 37+ $cont = @file_get_contents( $file );
3838 if ( empty( $cont ) )
3939 # Weird, should not happen
4040 return array();
4141 $arr = unserialize( $cont );
4242 if ( !is_array( $arr ) )
4343 # Weird, should not happen too
44 - return;
 44+ return array();
4545 return $arr;
4646 }
4747
@@ -57,7 +57,7 @@
5858 # maybe the time the user use this extensions, do not override
5959 # anything
6060 return array();
61 - $cont = file_get_contents( $file );
 61+ $cont = @file_get_contents( $file );
6262 if ( empty( $cont ) )
6363 # Weird, should not happen
6464 return array();
@@ -98,8 +98,8 @@
9999 $arch = $this->getArchiveFileName();
100100 $cur = $this->getFileName();
101101 $cont = serialize( $settings );
102 - file_put_contents( $arch, $cont );
103 - return ( file_put_contents( $cur, $cont ) !== false );
 102+ @file_put_contents( $arch, $cont );
 103+ return ( @file_put_contents( $cur, $cont ) !== false );
104104 }
105105
106106 /**
@@ -157,8 +157,6 @@
158158 * @return String full path to the file
159159 */
160160 public function getArchiveFileName( $ts = null ) {
161 - global $IP;
162 -
163161 if ( $ts === null )
164162 $ts = wfTimestampNow();
165163

Status & tagging log