Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -814,7 +814,6 @@ |
815 | 815 | /** getRel inherited */ |
816 | 816 | /** getUrlRel inherited */ |
817 | 817 | /** getArchiveRel inherited */ |
818 | | - /** getThumbRel inherited */ |
819 | 818 | /** getArchivePath inherited */ |
820 | 819 | /** getThumbPath inherited */ |
821 | 820 | /** getArchiveUrl inherited */ |
Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | */ |
135 | 135 | function resolveVirtualUrl( $url ) { |
136 | 136 | if ( substr( $url, 0, 9 ) != 'mwrepo://' ) { |
137 | | - throw new MWException( __METHOD__.': unknown protoocl' ); |
| 137 | + throw new MWException( __METHOD__.': unknown protocol' ); |
138 | 138 | } |
139 | 139 | |
140 | 140 | $bits = explode( '/', substr( $url, 9 ), 3 ); |
— | — | @@ -311,34 +311,34 @@ |
312 | 312 | $status = $this->newGood(); |
313 | 313 | |
314 | 314 | // Resolve the virtual URL |
315 | | - if ( self::isVirtualUrl( $srcPath ) ) { |
316 | | - $srcPath = $this->resolveVirtualUrl( $srcPath ); |
| 315 | + if ( self::isVirtualUrl( $toAppendPath ) ) { |
| 316 | + $toAppendPath = $this->resolveVirtualUrl( $toAppendPath ); |
317 | 317 | } |
318 | 318 | // Make sure the files are there |
| 319 | + if ( !is_file( $toAppendPath ) ) |
| 320 | + $status->fatal( 'filenotfound', $toAppendPath ); |
| 321 | + |
319 | 322 | if ( !is_file( $srcPath ) ) |
320 | 323 | $status->fatal( 'filenotfound', $srcPath ); |
321 | 324 | |
322 | | - if ( !is_file( $toAppendPath ) ) |
323 | | - $status->fatal( 'filenotfound', $toAppendPath ); |
324 | | - |
325 | 325 | if ( !$status->isOk() ) return $status; |
326 | 326 | |
327 | 327 | // Do the append |
328 | | - $chunk = file_get_contents( $toAppendPath ); |
| 328 | + $chunk = file_get_contents( $srcPath ); |
329 | 329 | if( $chunk === false ) { |
330 | | - $status->fatal( 'fileappenderrorread', $toAppendPath ); |
| 330 | + $status->fatal( 'fileappenderrorread', $srcPath ); |
331 | 331 | } |
332 | 332 | |
333 | 333 | if( $status->isOk() ) { |
334 | | - if ( file_put_contents( $srcPath, $chunk, FILE_APPEND ) ) { |
335 | | - $status->value = $srcPath; |
| 334 | + if ( file_put_contents( $toAppendPath, $chunk, FILE_APPEND ) ) { |
| 335 | + $status->value = $toAppendPath; |
336 | 336 | } else { |
337 | | - $status->fatal( 'fileappenderror', $toAppendPath, $srcPath); |
| 337 | + $status->fatal( 'fileappenderror', $srcPath, $toAppendPath); |
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
341 | 341 | if ( $flags & self::DELETE_SOURCE ) { |
342 | | - unlink( $toAppendPath ); |
| 342 | + unlink( $srcPath ); |
343 | 343 | } |
344 | 344 | |
345 | 345 | return $status; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | * - class The class name for the repository. May come from the core or an extension. |
318 | 318 | * The core repository classes are LocalRepo, ForeignDBRepo, FSRepo. |
319 | 319 | * |
320 | | - * - name A unique name for the repository. |
| 320 | + * - name A unique name for the repository (but $wgLocalFileRepo should be 'local'). |
321 | 321 | * |
322 | 322 | * For most core repos: |
323 | 323 | * - url Base public URL |