r11806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11805‎ | r11806 | r11807 >
Date:22:47, 26 November 2005
Author:avar
Status:old
Tags:
Comment:
* Internal reworking of code
* Use $wgContLang->lc() rather than strtolower()
Modified paths:
  • /trunk/phase3/includes/Exif.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exif.php
@@ -81,14 +81,28 @@
8282 var $mFormattedExifData;
8383
8484 /**#@-*/
 85+
 86+ /**#@+
 87+ * @var string
 88+ * @access private
 89+ */
 90+
 91+ /**
 92+ * The file being processed
 93+ */
 94+ var $file;
8595
8696 /**
 97+ * The basename of the file being processed
 98+ */
 99+ var $basename;
 100+
 101+ /**
87102 * The private log to log to
88 - *
89 - * @var string
90 - * @access private
91103 */
92104 var $log = 'exif';
 105+
 106+ /**#@-*/
93107
94108 /**
95109 * Constructor
@@ -281,13 +295,14 @@
282296 ),
283297 );
284298
285 - $basename = basename( $file );
 299+ $this->file = $file;
 300+ $this->basename = basename( $this->file );
286301
287302 $this->makeFlatExifTags();
288303
289 - $this->debugFile( $basename, __FUNCTION__, true );
 304+ $this->debugFile( $this->basename, __FUNCTION__, true );
290305 wfSuppressWarnings();
291 - $data = exif_read_data( $file );
 306+ $data = exif_read_data( $this->file );
292307 wfRestoreWarnings();
293308 /**
294309 * exif_read_data() will return false on invalid input, such as
@@ -299,7 +314,7 @@
300315 $this->makeFilteredData();
301316 $this->makeFormattedData();
302317
303 - $this->debugFile( $basename, __FUNCTION__, false );
 318+ $this->debugFile( __FUNCTION__, false );
304319 }
305320
306321 /**#@+
@@ -567,12 +582,12 @@
568583 * @paran string $fname The name of the function calling this function
569584 * @param bool $bool $io Specify whether we're beginning or ending
570585 */
571 - function debugFile( $basename, $fname, $io ) {
 586+ function debugFile( $fname, $io ) {
572587 $class = ucfirst( __CLASS__ );
573588 if ( $io )
574 - wfDebugLog( $this->log, "$class::$fname: begin processing: '$basename'\n" );
 589+ wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'\n" );
575590 else
576 - wfDebugLog( $this->log, "$class::$fname: end processing: '$basename'\n" );
 591+ wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'\n" );
577592 }
578593
579594 }
@@ -999,9 +1014,11 @@
10001015 * @return string A wfMsg of "exif-$tag-$val" in lower case
10011016 */
10021017 function msg( $tag, $val, $arg = null ) {
 1018+ global $wgContLang;
 1019+
10031020 if ($val === '')
10041021 $val = 'value';
1005 - return wfMsg( strtolower( "exif-$tag-$val" ), $arg );
 1022+ return wfMsg( $wgContLang->lc( "exif-$tag-$val" ), $arg );
10061023 }
10071024
10081025 /**

Status & tagging log