Index: trunk/extensions/Score/Score.i18n.php |
— | — | @@ -57,6 +57,8 @@ |
58 | 58 | 'score-compilererr' => 'Displayed if the LilyPond code could not be compiled. $1 is the error (generally big block of text in a pre tag)', |
59 | 59 | 'score-desc' => '{{desc}}', |
60 | 60 | 'score-getcwderr' => 'Displayed if the extension cannot obtain the CWD.', |
| 61 | + 'score-nooutput' => 'Displayed if the LilyPond image/midi dir cannot be created.', |
| 62 | + 'score-nofactory' => 'Displayed if the LilyPond/ImageMagick working directory cannot be created.', |
61 | 63 | 'score-noinput' => 'Displayed if the LilyPond input file cannot be created.', |
62 | 64 | 'score-page' => 'The word "Page" as used in pagination. $1 is the page number', |
63 | 65 | 'score-renameerr' => 'Displayed if moving the resultant files from the working environment to the upload directory fails.', |
Index: trunk/extensions/Score/README |
— | — | @@ -19,7 +19,9 @@ |
20 | 20 | subdirectory. Make sure they are readable by your webserver. |
21 | 21 | 4. Create a subdirectory named "lilypond" in your $wgUploadDirectory (usually |
22 | 22 | the directory named "images" in in your MediaWiki directory). Make sure |
23 | | - the directory is writable by your webserver. |
| 23 | + the directory is writable by your webserver. If you do not create this |
| 24 | + directory, the Score extension will attempt to create it for you with the |
| 25 | + rights available to it. |
24 | 26 | 5. Add the lines |
25 | 27 | |
26 | 28 | require_once("$IP/extensions/Score/Score.php"); |
Index: trunk/extensions/Score/Score.body.php |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | throw new ScoreException( 'score-cleanerr' ); |
165 | 165 | } |
166 | 166 | |
167 | | - /* create working environment */ |
| 167 | + /* create output directory if necessary */ |
168 | 168 | if ( !file_exists( "$wgUploadDirectory/$lilypondDir" ) ) { |
169 | 169 | $rc = wfMkdirParents( "$wgUploadDirectory/$lilypondDir", null, __METHOD__ ); |
170 | 170 | if ( !$rc ) { |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | $msg = wfMessage( 'score-compilererr' ) |
211 | 211 | ->inContentLanguage() |
212 | 212 | ->rawParams( |
213 | | - ' <pre>' . strip_tags( $output ) . "\n</pre>\n" |
| 213 | + ' ' . Html::rawElement( 'pre', array(), strip_tags( $output ) ) . "\n" |
214 | 214 | ); |
215 | 215 | return $msg; |
216 | 216 | } |
— | — | @@ -336,6 +336,9 @@ |
337 | 337 | if( file_exists( $dir ) ) { |
338 | 338 | array_map( 'unlink', glob( "$dir/*", GLOB_NOSORT ) ); |
339 | 339 | return rmdir( $dir ); |
| 340 | + } else { |
| 341 | + /* Nothing to do */ |
| 342 | + return true; |
340 | 343 | } |
341 | 344 | } |
342 | 345 | |