Index: trunk/extensions/Score/Score.php |
— | — | @@ -46,20 +46,14 @@ |
47 | 47 | * Default is $wgUseImageMagick and set in efScoreExtension */ |
48 | 48 | $wgScoreTrim = null; |
49 | 49 | |
50 | | -/* Path of lilypond executable */ |
51 | | -if ( !isset( $wgLilyPond ) ) { |
52 | | - $wgLilyPond = '/usr/bin/lilypond'; |
53 | | -} |
| 50 | +/* Path to LilyPond executable */ |
| 51 | +$wgScoreLilyPond = '/usr/bin/lilypond'; |
54 | 52 | |
55 | 53 | /* Path to converter from ABC */ |
56 | | -if ( !isset( $wgAbc2Ly ) ) { |
57 | | - $wgAbc2Ly = '/usr/bin/abc2ly'; |
58 | | -} |
| 54 | +$wgScoreAbc2Ly = '/usr/bin/abc2ly'; |
59 | 55 | |
60 | 56 | /* Path to TiMidity++ */ |
61 | | -if ( !isset( $wgTimidity ) ) { |
62 | | - $wgTimidity = '/usr/bin/timidity'; |
63 | | -} |
| 57 | +$wgScoreTimidity = '/usr/bin/timidity'; |
64 | 58 | |
65 | 59 | /* |
66 | 60 | * Extension credits |
Index: trunk/extensions/Score/Score.body.php |
— | — | @@ -108,13 +108,13 @@ |
109 | 109 | * @throws ScoreException if LilyPond could not be executed properly. |
110 | 110 | */ |
111 | 111 | private static function getLilypondVersion() { |
112 | | - global $wgLilyPond; |
| 112 | + global $wgScoreLilyPond; |
113 | 113 | |
114 | | - if ( !is_executable( $wgLilyPond ) ) { |
115 | | - throw new ScoreException( wfMessage( 'score-notexecutable', $wgLilyPond ) ); |
| 114 | + if ( !is_executable( $wgScoreLilyPond ) ) { |
| 115 | + throw new ScoreException( wfMessage( 'score-notexecutable', $wgScoreLilyPond ) ); |
116 | 116 | } |
117 | 117 | |
118 | | - $cmd = wfEscapeShellArg( $wgLilyPond ) . ' --version 2>&1'; |
| 118 | + $cmd = wfEscapeShellArg( $wgScoreLilyPond ) . ' --version 2>&1'; |
119 | 119 | $output = wfShellExec( $cmd, $rc ); |
120 | 120 | if ( $rc != 0 ) { |
121 | 121 | self::throwCallException( wfMessage( 'score-versionerr' ), $output ); |
— | — | @@ -310,7 +310,7 @@ |
311 | 311 | * @throws ScoreException on error. |
312 | 312 | */ |
313 | 313 | private static function generatePngAndMidi( $code, $options, $filePrefix, $factoryDirectory ) { |
314 | | - global $wgLilyPond, $wgScoreTrim; |
| 314 | + global $wgScoreLilyPond, $wgScoreTrim; |
315 | 315 | |
316 | 316 | wfProfileIn( __METHOD__ ); |
317 | 317 | |
— | — | @@ -377,10 +377,10 @@ |
378 | 378 | if ( !$rc ) { |
379 | 379 | throw new ScoreException( wfMessage( 'score-chdirerr', $factoryDirectory ) ); |
380 | 380 | } |
381 | | - if ( !is_executable( $wgLilyPond ) ) { |
382 | | - throw new ScoreException( wfMessage( 'score-notexecutable', $wgLilyPond ) ); |
| 381 | + if ( !is_executable( $wgScoreLilyPond ) ) { |
| 382 | + throw new ScoreException( wfMessage( 'score-notexecutable', $wgScoreLilyPond ) ); |
383 | 383 | } |
384 | | - $cmd = wfEscapeShellArg( $wgLilyPond ) |
| 384 | + $cmd = wfEscapeShellArg( $wgScoreLilyPond ) |
385 | 385 | . ' -dsafe=' |
386 | 386 | . wfEscapeShellArg( '#t' ) |
387 | 387 | . ' -dbackend=eps --png --header=texidoc ' |
— | — | @@ -478,7 +478,7 @@ |
479 | 479 | * @throws ScoreException if an error occurs. |
480 | 480 | */ |
481 | 481 | private static function generateOgg( $options, $filePrefix, $factoryDirectory ) { |
482 | | - global $wgTimidity; |
| 482 | + global $wgScoreTimidity; |
483 | 483 | |
484 | 484 | wfProfileIn( __METHOD__ ); |
485 | 485 | |
— | — | @@ -490,10 +490,10 @@ |
491 | 491 | $ogg = "$filePrefix.ogg"; |
492 | 492 | |
493 | 493 | /* Run timidity */ |
494 | | - if ( !is_executable( $wgTimidity ) ) { |
495 | | - throw new ScoreException( wfMessage( 'score-timiditynotexecutable', $wgTimidity ) ); |
| 494 | + if ( !is_executable( $wgScoreTimidity ) ) { |
| 495 | + throw new ScoreException( wfMessage( 'score-timiditynotexecutable', $wgScoreTimidity ) ); |
496 | 496 | } |
497 | | - $cmd = wfEscapeShellArg( $wgTimidity ) |
| 497 | + $cmd = wfEscapeShellArg( $wgScoreTimidity ) |
498 | 498 | . ' -Ov' // Vorbis output |
499 | 499 | . ' --output-file=' . wfEscapeShellArg( $factoryOgg ) |
500 | 500 | . ' ' . wfEscapeShellArg( $midi ) |
— | — | @@ -563,7 +563,7 @@ |
564 | 564 | * @throws ScoreException if the conversion fails. |
565 | 565 | */ |
566 | 566 | private function generateLilypondFromAbc( $code, $factoryDirectory ) { |
567 | | - global $wgAbc2Ly; |
| 567 | + global $wgScoreAbc2Ly; |
568 | 568 | |
569 | 569 | $factoryAbc = "$factoryDirectory/file.abc"; |
570 | 570 | $factoryLy = "$factoryDirectory/file.ly"; |
— | — | @@ -575,11 +575,11 @@ |
576 | 576 | } |
577 | 577 | |
578 | 578 | /* Convert to LilyPond file */ |
579 | | - if ( !is_executable( $wgAbc2Ly ) ) { |
580 | | - throw new ScoreException( wfMessage( 'score-abc2lynotexecutable', $wgAbc2Ly ) ); |
| 579 | + if ( !is_executable( $wgScoreAbc2Ly ) ) { |
| 580 | + throw new ScoreException( wfMessage( 'score-abc2lynotexecutable', $wgScoreAbc2Ly ) ); |
581 | 581 | } |
582 | 582 | |
583 | | - $cmd = wfEscapeShellArg( $wgAbc2Ly ) |
| 583 | + $cmd = wfEscapeShellArg( $wgScoreAbc2Ly ) |
584 | 584 | . ' -s' |
585 | 585 | . ' --output=' . wfEscapeShellArg( $factoryLy ) |
586 | 586 | . ' ' . wfEscapeShellArg( $factoryAbc ) |