r84563 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84562‎ | r84563 | r84564 >
Date:21:39, 22 March 2011
Author:dale
Status:ok
Tags:
Comment:
use array_merge instead of array loop
moved class that configuration depends on above configuration
Modified paths:
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.php
@@ -10,6 +10,12 @@
1111 exit( 1 );
1212 }
1313
 14+// Set up the timed media handler dir:
 15+$timedMediaDir = dirname(__FILE__);
 16+// Include WebVideoTranscode ( prior to config so that its defined transcode keys can be used in configuration )
 17+$wgAutoloadClasses['WebVideoTranscode'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscode.php";
 18+
 19+
1420 /******************* CONFIGURATION STARTS HERE **********************/
1521
1622 /*** MwEmbed module configuration: *********************************/
@@ -74,18 +80,13 @@
7581 );
7682 /******************* CONFIGURATION ENDS HERE **********************/
7783
78 -// Set up the timed media handler dir:
79 -$timedMediaDir = dirname(__FILE__);
8084
81 -// List of extensions handled by Timed Media Handler since its refrenced in a few places.
 85+
 86+// List of extensions handled by Timed Media Handler since its referenced in a few places.
8287 // you should not modify this variable
8388 $tmhFileExtensions = array( 'ogg', 'ogv', 'oga', 'webm');
8489
85 -foreach($tmhFileExtensions as $ext ){
86 - if ( !in_array( $ext, $wgFileExtensions ) ) {
87 - $wgFileExtensions[] = $ext;
88 - }
89 -}
 90+$wgFileExtensions = array_merge($wgFileExtensions, $tmhFileExtensions);
9091
9192 // Timed Media Handler AutoLoad Classes:
9293 $wgAutoloadClasses['TimedMediaHandler'] = "$timedMediaDir/TimedMediaHandler_body.php";
@@ -109,7 +110,6 @@
110111 $wgAutoloadClasses['TextHandler'] = "$timedMediaDir/handlers/TextHandler/TextHandler.php";
111112
112113 // Transcode support
113 -$wgAutoloadClasses['WebVideoTranscode'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscode.php";
114114 $wgAutoloadClasses['WebVideoTranscodeJob'] = "$timedMediaDir/WebVideoTranscode/WebVideoTranscodeJob.php";
115115 $wgAutoloadClasses['ApiQueryVideoInfo'] = "$timedMediaDir/ApiQueryVideoInfo.php";
116116

Status & tagging log