r103353 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103352‎ | r103353 | r103354 >
Date:18:59, 16 November 2011
Author:dale
Status:ok
Tags:
Comment:
check for file before checking for file size
Modified paths:
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -31,7 +31,7 @@
3232 private function getTargetEncodePath(){
3333 if( !$this->targetEncodePath ){
3434 $file = wfLocalFile( $this->title );
35 - $transcodeKey = $this->params['transcodeKey'];
 35+ $transcodeKey = $this->params[ 'transcodeKey' ];
3636 $this->targetEncodePath = WebVideoTranscode::getTargetEncodePath( $file, $transcodeKey );
3737 }
3838 return $this->targetEncodePath;
@@ -496,9 +496,9 @@
497497 // only run check if we are outputing to target file
498498 // ( two pass encoding does not output to target on first pass )
499499 clearstatcache();
500 - $newFileSize = filesize( $this->getTargetEncodePath() );
 500+ $newFileSize = is_file( $this->getTargetEncodePath() ) ? filesize( $this->getTargetEncodePath() ) : 0;
501501 // Don't start checking for file growth until we have an initial positive file size:
502 - if( is_file( $this->getTargetEncodePath() ) && $newFileSize > 0 ){
 502+ if( $newFileSize > 0 ){
503503 $this->output( $wgLang->formatSize( $newFileSize ). ' Total size, encoding ' .
504504 $wgLang->formatSize( ( $newFileSize - $oldFileSize ) / 5 ) . ' per second' );
505505 if( $newFileSize == $oldFileSize ){

Status & tagging log