Index: trunk/extensions/TimedMediaHandler/maintenance/WebVideoJobRunner.php |
— | — | @@ -30,6 +30,8 @@ |
31 | 31 | } |
32 | 32 | if ( $this->hasOption( "wiki" ) ) { |
33 | 33 | $this->wiki = $this->getOption( 'wiki' ) ; |
| 34 | + } else { |
| 35 | + $this->wiki = false; |
34 | 36 | } |
35 | 37 | // Check if WebVideoJobRuner is already running: |
36 | 38 | $jobRunnerCount = 0; |
— | — | @@ -68,13 +70,20 @@ |
69 | 71 | } |
70 | 72 | } |
71 | 73 | } |
72 | | - if( $runingJobsCount < $this->threads ){ |
| 74 | + if( $runingJobsCount < $this->threads ){ |
73 | 75 | // Add one process: |
74 | | - $cmd = "php $IP/maintenance/runJobs.php"; |
| 76 | + $parameters = array(); |
75 | 77 | if( $this->wiki ) { |
76 | | - $cmd .= " --wiki " . wfEscapeShellArg ( $this->wiki ); |
| 78 | + $parameters[] = '--wiki'; |
| 79 | + $parameters[] = $this->wiki; |
77 | 80 | } |
78 | | - $cmd .= " --type webVideoTranscode --maxjobs 1 --maxtime {$wgTranscodeBackgroundTimeLimit}"; |
| 81 | + $parameters[] = '--type'; |
| 82 | + $parameters[] = 'webVideoTranscode'; |
| 83 | + $parameters[] = '--maxjobs'; |
| 84 | + $parameters[] = '1'; |
| 85 | + $parameters[] = '--maxtime'; |
| 86 | + $parameters[] = $wgTranscodeBackgroundTimeLimit; |
| 87 | + $cmd = wfShellMaintenanceCmd("$IP/maintenance/runJobs.php", $parameters); |
79 | 88 | $status = $this->runBackgroundProc( $cmd ); |
80 | 89 | $this->output( "$runingJobsCount existing job runners, Check for new transcode jobs: " ); |
81 | 90 | } else { |