r104801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104800‎ | r104801 | r104802 >
Date:00:12, 1 December 2011
Author:aaron
Status:deferred
Tags:
Comment:
* Renamed 'source' => 'src', 'dest' => 'dst', and 'directory' => 'dir' in operation params to be less verbose
* Fixed undefined $parmams var in FileOp::checkAndBackupDest()
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/LocalRepo.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileOp.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/file/ForeignAPIFile.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/file/LocalFile.php (modified) (history)
  • /branches/FileBackend/phase3/includes/media/Generic.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -296,7 +296,7 @@
297297 # @todo FIXME: Delete old thumbs that aren't being used. Maintenance script?
298298 wfSuppressWarnings();
299299 $backend = $this->getBackend();
300 - $op = array( 'op' => 'create', 'dest' => $localFilename, 'content' => $thumb );
 300+ $op = array( 'op' => 'create', 'dst' => $localFilename, 'content' => $thumb );
301301 if( !$backend->doOperation( $op )->isOK() ) {
302302 wfRestoreWarnings();
303303 wfDebug( __METHOD__ . " could not write to thumb path\n" );
Index: branches/FileBackend/phase3/includes/filerepo/file/LocalFile.php
@@ -604,7 +604,7 @@
605605
606606 if ( $this->repo->fileExists( $thumbDir, FileRepo::FILES_ONLY ) ) {
607607 // File where directory should be
608 - $op = array( 'op' => 'delete', 'source' => $thumbDir );
 608+ $op = array( 'op' => 'delete', 'src' => $thumbDir );
609609 $this->repo->getBackend()->doOperation( $op );
610610 }
611611 }
@@ -629,7 +629,7 @@
630630
631631 $backend = $this->repo->getBackend();
632632 $files = array( $dir );
633 - $iterator = $backend->getFileList( array( 'directory' => $dir ) );
 633+ $iterator = $backend->getFileList( array( 'dir' => $dir ) );
634634 foreach ( $iterator as $file ) {
635635 $files[] = $file;
636636 }
@@ -757,12 +757,12 @@
758758 # Check that the base file name is part of the thumb name
759759 # This is a basic sanity check to avoid erasing unrelated directories
760760 if ( strpos( $file, $this->getName() ) !== false ) {
761 - $op = array( 'op' => 'delete', 'source' => "{$dir}/{$file}" );
 761+ $op = array( 'op' => 'delete', 'src' => "{$dir}/{$file}" );
762762 $backend->doOperation( $op );
763763 }
764764 }
765765 # Clear out directory if empty
766 - $backend->clean( array( 'directory' => $dir ) );
 766+ $backend->clean( array( 'dir' => $dir ) );
767767 }
768768
769769 /** purgeDescription inherited */
Index: branches/FileBackend/phase3/includes/filerepo/file/ForeignAPIFile.php
@@ -198,7 +198,7 @@
199199
200200 function getThumbnails() {
201201 $dir = $this->getThumbPath( $this->getName() );
202 - $iter = $this->repo->getBackend()->getFileList( array( 'directory' => $dir ) );
 202+ $iter = $this->repo->getBackend()->getFileList( array( 'dir' => $dir ) );
203203
204204 $files = array();
205205 foreach ( $iter as $file ) {
@@ -241,9 +241,9 @@
242242
243243 $dir = $this->getThumbPath( $this->getName() );
244244 foreach ( $files as $file ) {
245 - $op = array( 'op' => 'delete', 'source' => "{$dir}{$file}" );
 245+ $op = array( 'op' => 'delete', 'src' => "{$dir}{$file}" );
246246 $backend->doOperation( $op );
247247 }
248 - $backend->clean( array( 'directory' => $dir ) );
 248+ $backend->clean( array( 'dir' => $dir ) );
249249 }
250250 }
Index: branches/FileBackend/phase3/includes/filerepo/LocalRepo.php
@@ -71,7 +71,7 @@
7272 $hidden = $this->hiddenFileHasKey( $key, 'lock' );
7373 if ( !$deleted && !$hidden ) { // not in use now
7474 wfDebug( __METHOD__ . ": deleting $key\n" );
75 - $op = array( 'op' => 'delete', 'source' => $path );
 75+ $op = array( 'op' => 'delete', 'src' => $path );
7676 if ( !$backend->doOperation( $op )->isOK() ) {
7777 $status->error( 'undelete-cleanup-error', $path );
7878 $status->failCount++;
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -233,7 +233,7 @@
234234 return $status; // died mid-stream...so this is already fubar
235235 }
236236 }
237 - return Status::newFatal( 'backend-fail-stream', $params['source'] );
 237+ return Status::newFatal( 'backend-fail-stream', $params['src'] );
238238 }
239239
240240 function getLocalCopy( array $params ) {
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileOp.php
@@ -175,12 +175,12 @@
176176 protected function backupSource() {
177177 $status = Status::newGood();
178178 // Check if a file already exists at the source...
179 - $params = array( 'source' => $this->params['source'] );
 179+ $params = array( 'src' => $this->params['src'] );
180180 if ( $this->backend->fileExists( $params ) ) {
181181 // Create a temporary backup copy...
182182 $this->tmpSourcePath = $this->backend->getLocalCopy( $params );
183183 if ( $this->tmpSourcePath === null ) {
184 - $status->fatal( 'backend-fail-backup', $this->params['source'] );
 184+ $status->fatal( 'backend-fail-backup', $this->params['src'] );
185185 return $status;
186186 }
187187 }
@@ -201,9 +201,10 @@
202202
203203 if ( !empty( $this->params['overwriteDest'] ) ) {
204204 // Create a temporary backup copy...
 205+ $params = array( 'src' => $this->params['dst'] );
205206 $this->tmpDestFile = $this->backend->getLocalCopy( $params );
206207 if ( !$this->tmpDestFile ) {
207 - $status->fatal( 'backend-fail-backup', $this->params['dest'] );
 208+ $status->fatal( 'backend-fail-backup', $this->params['dst'] );
208209 return $status;
209210 }
210211 } elseif ( !empty( $this->params['overwriteSame'] ) ) {
@@ -212,19 +213,19 @@
213214 // If there is a single source, then we can do some checks already.
214215 // For things like concatenate(), we need to build a temp file first.
215216 if ( $shash !== null ) {
216 - $dhash = $this->getFileMD5( $this->params['dest'] );
 217+ $dhash = $this->getFileMD5( $this->params['dst'] );
217218 if ( !strlen( $shash ) || !strlen( $dhash ) ) {
218219 $status->fatal( 'backend-fail-hashes' );
219220 return $status;
220221 }
221222 // Give an error if the files are not identical
222223 if ( $shash !== $dhash ) {
223 - $status->fatal( 'backend-fail-notsame', $this->params['dest'] );
 224+ $status->fatal( 'backend-fail-notsame', $this->params['dst'] );
224225 }
225226 return $status; // do nothing; either OK or bad status
226227 }
227228 } else {
228 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 229+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
229230 return $status;
230231 }
231232
@@ -254,7 +255,7 @@
255256 if ( $this->backend->getHashType() === 'md5' ) {
256257 $hash = $this->backend->getFileHash( $path );
257258 } else {
258 - $tmp = $this->backend->getLocalCopy( array( 'source' => $path ) );
 259+ $tmp = $this->backend->getLocalCopy( array( 'src' => $path ) );
259260 if ( !$tmp ) {
260261 return false; // error
261262 }
@@ -277,8 +278,8 @@
278279 // Restore any file that was at the destination
279280 if ( $this->tmpSourcePath !== null ) {
280281 $params = array(
281 - 'source' => $this->tmpSourcePath,
282 - 'dest' => $this->params['source']
 282+ 'src' => $this->tmpSourcePath,
 283+ 'dst' => $this->params['src']
283284 );
284285 $status = $this->backend->store( $params );
285286 if ( !$status->isOK() ) {
@@ -298,8 +299,8 @@
299300 // Restore any file that was at the destination
300301 if ( $this->tmpDestFile ) {
301302 $params = array(
302 - 'source' => $this->tmpDestFile->getPath(),
303 - 'dest' => $this->params['dest']
 303+ 'src' => $this->tmpDestFile->getPath(),
 304+ 'dst' => $this->params['dst']
304305 );
305306 $status = $this->backend->store( $params );
306307 if ( !$status->isOK() ) {
@@ -320,7 +321,7 @@
321322 if ( isset( $predicates['exists'][$source] ) ) {
322323 return $predicates['exists'][$source]; // previous op assures this
323324 } else {
324 - return $this->backend->fileExists( array( 'source' => $source ) );
 325+ return $this->backend->fileExists( array( 'src' => $source ) );
325326 }
326327 }
327328 }
@@ -328,8 +329,8 @@
329330 /**
330331 * Store a file into the backend from a file on the file system.
331332 * Parameters similar to FileBackend::store(), which include:
332 - * source : source path on file system
333 - * dest : destination storage path
 333+ * src : source path on file system
 334+ * dst : destination storage path
334335 * overwriteDest : do nothing and pass if an identical file exists at destination
335336 * overwriteSame : override any existing file at destination
336337 */
@@ -337,21 +338,21 @@
338339 protected function doPrecheck( array &$predicates ) {
339340 $status = Status::newGood();
340341 // Check if destination file exists
341 - if ( $this->fileExists( $this->params['dest'], $predicates ) ) {
 342+ if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
342343 if ( empty( $this->params['overwriteDest'] ) ) {
343 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 344+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
344345 return $status;
345346 }
346347 } else {
347348 $this->checkDest = false;
348349 }
349350 // Check if the source file exists on the file system
350 - if ( !file_exists( $this->params['source'] ) ) {
351 - $status->fatal( 'backend-fail-notexists', $this->params['source'] );
 351+ if ( !file_exists( $this->params['src'] ) ) {
 352+ $status->fatal( 'backend-fail-notexists', $this->params['src'] );
352353 return $status;
353354 }
354355 // Update file existence predicates
355 - $predicates['exists'][$this->params['dest']] = true;
 356+ $predicates['exists'][$this->params['dst']] = true;
356357 return $status;
357358 }
358359
@@ -371,7 +372,7 @@
372373
373374 protected function doRevert() {
374375 // Remove the file saved to the destination
375 - $params = array( 'source' => $this->params['dest'] );
 376+ $params = array( 'src' => $this->params['dst'] );
376377 $status = $this->backend->delete( $params );
377378 if ( !$status->isOK() ) {
378379 return $status; // also can't restore any dest file
@@ -382,11 +383,11 @@
383384 }
384385
385386 protected function getSourceMD5() {
386 - return md5_file( $this->params['source'] );
 387+ return md5_file( $this->params['src'] );
387388 }
388389
389390 function storagePathsUsed() {
390 - return array( $this->params['dest'] );
 391+ return array( $this->params['dst'] );
391392 }
392393 }
393394
@@ -394,7 +395,7 @@
395396 * Create a file in the backend with the given content.
396397 * Parameters similar to FileBackend::create(), which include:
397398 * content : a string of raw file contents
398 - * dest : destination storage path
 399+ * dst : destination storage path
399400 * overwriteDest : do nothing and pass if an identical file exists at destination
400401 * overwriteSame : override any existing file at destination
401402 */
@@ -402,16 +403,16 @@
403404 protected function doPrecheck( array &$predicates ) {
404405 $status = Status::newGood();
405406 // Check if destination file exists
406 - if ( $this->fileExists( $this->params['dest'], $predicates ) ) {
 407+ if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
407408 if ( empty( $this->params['overwriteDest'] ) ) {
408 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 409+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
409410 return $status;
410411 }
411412 } else {
412413 $this->checkDest = false;
413414 }
414415 // Update file existence predicates
415 - $predicates['exists'][$this->params['dest']] = true;
 416+ $predicates['exists'][$this->params['dst']] = true;
416417 return $status;
417418 }
418419
@@ -431,7 +432,7 @@
432433
433434 protected function doRevert() {
434435 // Remove the file saved to the destination
435 - $params = array( 'source' => $this->params['dest'] );
 436+ $params = array( 'src' => $this->params['dst'] );
436437 $status = $this->backend->delete( $params );
437438 if ( !$status->isOK() ) {
438439 return $status; // also can't restore any dest file
@@ -446,15 +447,15 @@
447448 }
448449
449450 function storagePathsUsed() {
450 - return array( $this->params['dest'] );
 451+ return array( $this->params['dst'] );
451452 }
452453 }
453454
454455 /**
455456 * Copy a file from one storage path to another in the backend.
456457 * Parameters similar to FileBackend::copy(), which include:
457 - * source : source storage path
458 - * dest : destination storage path
 458+ * src : source storage path
 459+ * dst : destination storage path
459460 * overwriteDest : do nothing and pass if an identical file exists at destination
460461 * overwriteSame : override any existing file at destination
461462 */
@@ -464,21 +465,21 @@
465466 protected function doPrecheck( array &$predicates ) {
466467 $status = Status::newGood();
467468 // Check if destination file exists
468 - if ( $this->fileExists( $this->params['dest'], $predicates ) ) {
 469+ if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
469470 if ( empty( $this->params['overwriteDest'] ) ) {
470 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 471+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
471472 return $status;
472473 }
473474 } else {
474475 $this->checkDest = false;
475476 }
476477 // Check if the source file exists
477 - if ( !$this->fileExists( $this->params['source'], $predicates ) ) {
478 - $status->fatal( 'backend-fail-notexists', $this->params['source'] );
 478+ if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
 479+ $status->fatal( 'backend-fail-notexists', $this->params['src'] );
479480 return $status;
480481 }
481482 // Update file existence predicates
482 - $predicates['exists'][$this->params['dest']] = true;
 483+ $predicates['exists'][$this->params['dst']] = true;
483484 return $status;
484485 }
485486
@@ -499,7 +500,7 @@
500501 protected function doRevert() {
501502 $status = Status::newGood();
502503 // Remove the file saved to the destination
503 - $params = array( 'source' => $this->params['dest'] );
 504+ $params = array( 'src' => $this->params['dst'] );
504505 $status->merge( $this->backend->delete( $params ) );
505506 if ( !$status->isOK() ) {
506507 return $status; // also can't restore any dest file
@@ -510,19 +511,19 @@
511512 }
512513
513514 protected function getSourceMD5() {
514 - return $this->getFileMD5( $this->params['source'] );
 515+ return $this->getFileMD5( $this->params['src'] );
515516 }
516517
517518 function storagePathsUsed() {
518 - return array( $this->params['source'], $this->params['dest'] );
 519+ return array( $this->params['src'], $this->params['dst'] );
519520 }
520521 }
521522
522523 /**
523524 * Move a file from one storage path to another in the backend.
524525 * Parameters similar to FileBackend::move(), which include:
525 - * source : source storage path
526 - * dest : destination storage path
 526+ * src : source storage path
 527+ * dst : destination storage path
527528 * overwriteDest : do nothing and pass if an identical file exists at destination
528529 * overwriteSame : override any existing file at destination
529530 */
@@ -538,22 +539,22 @@
539540 protected function doPrecheck( array &$predicates ) {
540541 $status = Status::newGood();
541542 // Check if destination file exists
542 - if ( $this->fileExists( $this->params['dest'], $predicates ) ) {
 543+ if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
543544 if ( empty( $this->params['overwriteDest'] ) ) {
544 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 545+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
545546 return $status;
546547 }
547548 } else {
548549 $this->checkDest = false;
549550 }
550551 // Check if the source file exists
551 - if ( !$this->fileExists( $this->params['source'], $predicates ) ) {
552 - $status->fatal( 'backend-fail-notexists', $this->params['source'] );
 552+ if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
 553+ $status->fatal( 'backend-fail-notexists', $this->params['src'] );
553554 return $status;
554555 }
555556 // Update file existence predicates
556 - $predicates['exists'][$this->params['source']] = false;
557 - $predicates['exists'][$this->params['dest']] = true;
 557+ $predicates['exists'][$this->params['src']] = false;
 558+ $predicates['exists'][$this->params['dst']] = true;
558559 return $status;
559560 }
560561
@@ -577,7 +578,7 @@
578579 return $status;
579580 }
580581 // Delete source
581 - $params = array( 'source' => $this->params['source'] );
 582+ $params = array( 'src' => $this->params['src'] );
582583 $status->merge( $this->backend->delete( $params ) );
583584 if ( !$status->isOK() ) {
584585 return $status;
@@ -591,8 +592,8 @@
592593 // Native moves: move the file back to the source
593594 if ( $this->usingMove ) {
594595 $params = array(
595 - 'source' => $this->params['dest'],
596 - 'dest' => $this->params['source']
 596+ 'src' => $this->params['dst'],
 597+ 'dst' => $this->params['src']
597598 );
598599 $status->merge( $this->backend->move( $params ) );
599600 if ( !$status->isOK() ) {
@@ -601,13 +602,13 @@
602603 // Non-native moves: remove the file saved to the destination
603604 } else {
604605 // Copy destination back to source
605 - $params = array( 'source' => $this->params['dest'], 'dest' => $this->params['source'] );
 606+ $params = array( 'src' => $this->params['dst'], 'dst' => $this->params['src'] );
606607 $status = $this->backend->copy( $params );
607608 if ( !$status->isOK() ) {
608609 return $status; // also can't restore any dest file
609610 }
610611 // Delete destination
611 - $params = array( 'source' => $this->params['dest'] );
 612+ $params = array( 'src' => $this->params['dst'] );
612613 $status = $this->backend->delete( $params );
613614 if ( !$status->isOK() ) {
614615 return $status; // also can't restore any dest file
@@ -619,11 +620,11 @@
620621 }
621622
622623 protected function getSourceMD5() {
623 - return $this->getFileMD5( $this->params['source'] );
 624+ return $this->getFileMD5( $this->params['src'] );
624625 }
625626
626627 function storagePathsUsed() {
627 - return array( $this->params['source'], $this->params['dest'] );
 628+ return array( $this->params['src'], $this->params['dst'] );
628629 }
629630 }
630631
@@ -631,7 +632,7 @@
632633 * Combines files from severals storage paths into a new file in the backend.
633634 * Parameters similar to FileBackend::concatenate(), which include:
634635 * sources : ordered source storage paths (e.g. chunk1,chunk2,...)
635 - * dest : destination storage path
 636+ * dst : destination storage path
636637 * overwriteDest : do nothing and pass if an identical file exists at destination
637638 */
638639 class ConcatenateFileOp extends FileOp {
@@ -640,9 +641,9 @@
641642 protected function doPrecheck( array &$predicates ) {
642643 $status = Status::newGood();
643644 // Check if destination file exists
644 - if ( $this->fileExists( $this->params['dest'], $predicates ) ) {
 645+ if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
645646 if ( empty( $this->params['overwriteDest'] ) ) {
646 - $status->fatal( 'backend-fail-alreadyexists', $this->params['dest'] );
 647+ $status->fatal( 'backend-fail-alreadyexists', $this->params['dst'] );
647648 return $status;
648649 }
649650 } else {
@@ -656,7 +657,7 @@
657658 }
658659 }
659660 // Update file existence predicates
660 - $predicates['exists'][$this->params['dest']] = true;
 661+ $predicates['exists'][$this->params['dst']] = true;
661662 return $status;
662663 }
663664
@@ -676,7 +677,7 @@
677678
678679 protected function doRevert() {
679680 // Remove the file saved to the destination
680 - $params = array( 'source' => $this->params['dest'] );
 681+ $params = array( 'src' => $this->params['dst'] );
681682 $status = $this->backend->delete( $params );
682683 if ( !$status->isOK() ) {
683684 return $status; // also can't restore any dest file
@@ -691,14 +692,14 @@
692693 }
693694
694695 function storagePathsUsed() {
695 - return array_merge( $this->params['sources'], $this->params['dest'] );
 696+ return array_merge( $this->params['sources'], $this->params['dst'] );
696697 }
697698 }
698699
699700 /**
700701 * Delete a file at the storage path.
701702 * Parameters similar to FileBackend::delete(), which include:
702 - * source : source storage path
 703+ * src : source storage path
703704 * ignoreMissingSource : don't return an error if the file does not exist
704705 */
705706 class DeleteFileOp extends FileOp {
@@ -707,15 +708,15 @@
708709 protected function doPrecheck( array &$predicates ) {
709710 $status = Status::newGood();
710711 // Check if the source file exists
711 - if ( !$this->fileExists( $this->params['source'], $predicates ) ) {
 712+ if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
712713 if ( empty( $this->params['ignoreMissingSource'] ) ) {
713 - $status->fatal( 'backend-fail-notexists', $this->params['source'] );
 714+ $status->fatal( 'backend-fail-notexists', $this->params['src'] );
714715 return $status;
715716 }
716717 $this->needsDelete = false;
717718 }
718719 // Update file existence predicates
719 - $predicates['exists'][$this->params['source']] = false;
 720+ $predicates['exists'][$this->params['src']] = false;
720721 return $status;
721722 }
722723
@@ -742,7 +743,7 @@
743744 }
744745
745746 function storagePathsUsed() {
746 - return array( $this->params['source'] );
 747+ return array( $this->params['src'] );
747748 }
748749 }
749750
Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -37,9 +37,9 @@
3838 function store( array $params ) {
3939 $status = Status::newGood();
4040
41 - list( $c, $dest ) = $this->resolveStoragePath( $params['dest'] );
 41+ list( $c, $dest ) = $this->resolveStoragePath( $params['dst'] );
4242 if ( $dest === null ) {
43 - $status->fatal( 'backend-fail-invalidpath', $params['dest'] );
 43+ $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
4444 return $status;
4545 }
4646 if ( is_file( $dest ) ) {
@@ -48,25 +48,25 @@
4949 $ok = unlink( $dest );
5050 wfRestoreWarnings();
5151 if ( !$ok ) {
52 - $status->fatal( 'backend-fail-delete', $params['dest'] );
 52+ $status->fatal( 'backend-fail-delete', $params['dst'] );
5353 return $status;
5454 }
5555 } else {
56 - $status->fatal( 'backend-fail-alreadyexists', $params['dest'] );
 56+ $status->fatal( 'backend-fail-alreadyexists', $params['dst'] );
5757 return $status;
5858 }
5959 } else {
6060 if ( !wfMkdirParents( dirname( $dest ) ) ) {
61 - $status->fatal( 'directorycreateerror', $param['dest'] );
 61+ $status->fatal( 'directorycreateerror', $param['dst'] );
6262 return $status;
6363 }
6464 }
6565
6666 wfSuppressWarnings();
67 - $ok = copy( $params['source'], $dest );
 67+ $ok = copy( $params['src'], $dest );
6868 wfRestoreWarnings();
6969 if ( !$ok ) {
70 - $status->fatal( 'backend-fail-copy', $params['source'], $params['dest'] );
 70+ $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
7171 return $status;
7272 }
7373
@@ -78,12 +78,12 @@
7979 function copy( array $params ) {
8080 $status = Status::newGood();
8181
82 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 82+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
8383 if ( $source === null ) {
84 - $status->fatal( 'backend-fail-invalidpath', $params['source'] );
 84+ $status->fatal( 'backend-fail-invalidpath', $params['src'] );
8585 return $status;
8686 }
87 - $params['source'] = $source; // resolve source to FS path
 87+ $params['src'] = $source; // resolve source to FS path
8888
8989 return $this->store( $params ); // both source and dest are on FS
9090 }
@@ -95,14 +95,14 @@
9696 function move( array $params ) {
9797 $status = Status::newGood();
9898
99 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 99+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
100100 if ( $source === null ) {
101 - $status->fatal( 'backend-fail-invalidpath', $params['source'] );
 101+ $status->fatal( 'backend-fail-invalidpath', $params['src'] );
102102 return $status;
103103 }
104 - list( $c, $dest ) = $this->resolveStoragePath( $params['dest'] );
 104+ list( $c, $dest ) = $this->resolveStoragePath( $params['dst'] );
105105 if ( $dest === null ) {
106 - $status->fatal( 'backend-fail-invalidpath', $params['dest'] );
 106+ $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
107107 return $status;
108108 }
109109
@@ -114,17 +114,17 @@
115115 $ok = unlink( $dest );
116116 wfRestoreWarnings();
117117 if ( !$ok ) {
118 - $status->fatal( 'backend-fail-delete', $params['dest'] );
 118+ $status->fatal( 'backend-fail-delete', $params['dst'] );
119119 return $status;
120120 }
121121 }
122122 } else {
123 - $status->fatal( 'backend-fail-alreadyexists', $params['dest'] );
 123+ $status->fatal( 'backend-fail-alreadyexists', $params['dst'] );
124124 return $status;
125125 }
126126 } else {
127127 if ( !wfMkdirParents( dirname( $dest ) ) ) {
128 - $status->fatal( 'directorycreateerror', $param['dest'] );
 128+ $status->fatal( 'directorycreateerror', $param['dst'] );
129129 return $status;
130130 }
131131 }
@@ -134,7 +134,7 @@
135135 clearstatcache(); // file no longer at source
136136 wfRestoreWarnings();
137137 if ( !$ok ) {
138 - $status->fatal( 'backend-fail-move', $params['source'], $params['dest'] );
 138+ $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] );
139139 return $status;
140140 }
141141
@@ -144,15 +144,15 @@
145145 function delete( array $params ) {
146146 $status = Status::newGood();
147147
148 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 148+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
149149 if ( $source === null ) {
150 - $status->fatal( 'backend-fail-invalidpath', $params['source'] );
 150+ $status->fatal( 'backend-fail-invalidpath', $params['src'] );
151151 return $status;
152152 }
153153
154154 if ( !is_file( $source ) ) {
155155 if ( empty( $params['ignoreMissingSource'] ) ) {
156 - $status->fatal( 'backend-fail-delete', $params['source'] );
 156+ $status->fatal( 'backend-fail-delete', $params['src'] );
157157 }
158158 return $status; // do nothing; either OK or bad status
159159 }
@@ -161,7 +161,7 @@
162162 $ok = unlink( $source );
163163 wfRestoreWarnings();
164164 if ( !$ok ) {
165 - $status->fatal( 'backend-fail-delete', $params['source'] );
 165+ $status->fatal( 'backend-fail-delete', $params['src'] );
166166 return $status;
167167 }
168168
@@ -171,16 +171,16 @@
172172 function concatenate( array $params ) {
173173 $status = Status::newGood();
174174
175 - list( $c, $dest ) = $this->resolveStoragePath( $params['dest'] );
 175+ list( $c, $dest ) = $this->resolveStoragePath( $params['dst'] );
176176 if ( $dest === null ) {
177 - $status->fatal( 'backend-fail-invalidpath', $params['dest'] );
 177+ $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
178178 return $status;
179179 }
180180
181181 // Check if the destination file exists and we can't handle that
182182 $destExists = file_exists( $dest );
183183 if ( $destExists && empty( $params['overwriteDest'] ) ) {
184 - $status->fatal( 'backend-fail-alreadyexists', $params['dest'] );
 184+ $status->fatal( 'backend-fail-alreadyexists', $params['dst'] );
185185 return $status;
186186 }
187187
@@ -235,14 +235,14 @@
236236 $ok = unlink( $dest );
237237 wfRestoreWarnings();
238238 if ( !$ok ) {
239 - $status->fatal( 'backend-fail-delete', $params['dest'] );
 239+ $status->fatal( 'backend-fail-delete', $params['dst'] );
240240 return $status;
241241 }
242242 }
243243 } else {
244244 // Make sure destination directory exists
245245 if ( !wfMkdirParents( dirname( $dest ) ) ) {
246 - $status->fatal( 'directorycreateerror', $param['dest'] );
 246+ $status->fatal( 'directorycreateerror', $param['dst'] );
247247 return $status;
248248 }
249249 }
@@ -252,7 +252,7 @@
253253 $ok = rename( $tmpPath, $dest );
254254 wfRestoreWarnings();
255255 if ( !$ok ) {
256 - $status->fatal( 'backend-fail-move', $tmpPath, $params['dest'] );
 256+ $status->fatal( 'backend-fail-move', $tmpPath, $params['dst'] );
257257 return $status;
258258 }
259259
@@ -264,9 +264,9 @@
265265 function create( array $params ) {
266266 $status = Status::newGood();
267267
268 - list( $c, $dest ) = $this->resolveStoragePath( $params['dest'] );
 268+ list( $c, $dest ) = $this->resolveStoragePath( $params['dst'] );
269269 if ( $dest === null ) {
270 - $status->fatal( 'backend-fail-invalidpath', $params['dest'] );
 270+ $status->fatal( 'backend-fail-invalidpath', $params['dst'] );
271271 return $status;
272272 }
273273
@@ -276,16 +276,16 @@
277277 $ok = unlink( $dest );
278278 wfRestoreWarnings();
279279 if ( !$ok ) {
280 - $status->fatal( 'backend-fail-delete', $param['dest'] );
 280+ $status->fatal( 'backend-fail-delete', $param['dst'] );
281281 return $status;
282282 }
283283 } else {
284 - $status->fatal( 'backend-fail-alreadyexists', $params['dest'] );
 284+ $status->fatal( 'backend-fail-alreadyexists', $params['dst'] );
285285 return $status;
286286 }
287287 } else {
288288 if ( !wfMkdirParents( dirname( $dest ) ) ) {
289 - $status->fatal( 'directorycreateerror', $param['dest'] );
 289+ $status->fatal( 'directorycreateerror', $param['dst'] );
290290 return $status;
291291 }
292292 }
@@ -294,7 +294,7 @@
295295 $ok = file_put_contents( $dest, $params['content'] );
296296 wfRestoreWarnings();
297297 if ( !$ok ) {
298 - $status->fatal( 'backend-fail-create', $params['dest'] );
 298+ $status->fatal( 'backend-fail-create', $params['dst'] );
299299 return $status;
300300 }
301301
@@ -305,19 +305,19 @@
306306
307307 function prepare( array $params ) {
308308 $status = Status::newGood();
309 - list( $c, $dir ) = $this->resolveStoragePath( $params['directory'] );
 309+ list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
310310 if ( $dir === null ) {
311 - $status->fatal( 'backend-fail-invalidpath', $params['directory'] );
 311+ $status->fatal( 'backend-fail-invalidpath', $params['dir'] );
312312 return $status; // invalid storage path
313313 }
314314 if ( !wfMkdirParents( $dir ) ) {
315 - $status->fatal( 'directorycreateerror', $param['directory'] );
 315+ $status->fatal( 'directorycreateerror', $param['dir'] );
316316 return $status;
317317 } elseif ( !is_writable( $dir ) ) {
318 - $status->fatal( 'directoryreadonlyerror', $param['directory'] );
 318+ $status->fatal( 'directoryreadonlyerror', $param['dir'] );
319319 return $status;
320320 } elseif ( !is_readable( $dir ) ) {
321 - $status->fatal( 'directorynotreadableerror', $param['directory'] );
 321+ $status->fatal( 'directorynotreadableerror', $param['dir'] );
322322 return $status;
323323 }
324324 return $status;
@@ -325,13 +325,13 @@
326326
327327 function secure( array $params ) {
328328 $status = Status::newGood();
329 - list( $c, $dir ) = $this->resolveStoragePath( $params['directory'] );
 329+ list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
330330 if ( $dir === null ) {
331 - $status->fatal( 'backend-fail-invalidpath', $params['directory'] );
 331+ $status->fatal( 'backend-fail-invalidpath', $params['dir'] );
332332 return $status; // invalid storage path
333333 }
334334 if ( !wfMkdirParents( $dir ) ) {
335 - $status->fatal( 'directorycreateerror', $param['directory'] );
 335+ $status->fatal( 'directorycreateerror', $param['dir'] );
336336 return $status;
337337 }
338338 // Add a .htaccess file to the root of the deleted zone
@@ -340,7 +340,7 @@
341341 $ok = file_put_contents( "{$dir}/.htaccess", "Deny from all\n" );
342342 wfRestoreWarnings();
343343 if ( !$ok ) {
344 - $status->fatal( 'backend-fail-create', $params['directory'] . '/.htaccess' );
 344+ $status->fatal( 'backend-fail-create', $params['dir'] . '/.htaccess' );
345345 return $status;
346346 }
347347 }
@@ -350,7 +350,7 @@
351351 $ok = file_put_contents( "{$dir}/index.html", '' );
352352 wfRestoreWarnings();
353353 if ( !$ok ) {
354 - $status->fatal( 'backend-fail-create', $params['dest'] . '/index.html' );
 354+ $status->fatal( 'backend-fail-create', $params['dst'] . '/index.html' );
355355 return $status;
356356 }
357357 }
@@ -359,9 +359,9 @@
360360
361361 function clean( array $params ) {
362362 $status = Status::newGood();
363 - list( $c, $dir ) = $this->resolveStoragePath( $params['directory'] );
 363+ list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
364364 if ( $dir === null ) {
365 - $status->fatal( 'backend-fail-invalidpath', $params['directory'] );
 365+ $status->fatal( 'backend-fail-invalidpath', $params['dir'] );
366366 return $status; // invalid storage path
367367 }
368368 wfSuppressWarnings();
@@ -373,7 +373,7 @@
374374 }
375375
376376 function fileExists( array $params ) {
377 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 377+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
378378 if ( $source === null ) {
379379 return false; // invalid storage path
380380 }
@@ -385,7 +385,7 @@
386386 }
387387
388388 function getFileHash( array $params ) {
389 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 389+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
390390 if ( $source === null ) {
391391 return false; // invalid storage path
392392 }
@@ -393,7 +393,7 @@
394394 }
395395
396396 function getFileTimestamp( array $params ) {
397 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 397+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
398398 if ( $source === null ) {
399399 return false; // invalid storage path
400400 }
@@ -402,7 +402,7 @@
403403 }
404404
405405 function getFileProps( array $params ) {
406 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 406+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
407407 if ( $source === null ) {
408408 return FSFile::placeholderProps(); // invalid storage path
409409 }
@@ -411,7 +411,7 @@
412412 }
413413
414414 function getFileList( array $params ) {
415 - list( $c, $dir ) = $this->resolveStoragePath( $params['directory'] );
 415+ list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
416416 if ( $dir === null ) { // invalid storage path
417417 return array(); // empty result
418418 }
@@ -421,15 +421,15 @@
422422 function streamFile( array $params ) {
423423 $status = Status::newGood();
424424
425 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 425+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
426426 if ( $source === null ) {
427 - $status->fatal( 'backend-fail-invalidpath', $params['source'] );
 427+ $status->fatal( 'backend-fail-invalidpath', $params['src'] );
428428 return $status;
429429 }
430430
431431 $ok = StreamFile::stream( $source, array(), false );
432432 if ( !$ok ) {
433 - $status->fatal( 'backend-fail-stream', $params['source'] );
 433+ $status->fatal( 'backend-fail-stream', $params['src'] );
434434 return $status;
435435 }
436436
@@ -437,7 +437,7 @@
438438 }
439439
440440 function getLocalCopy( array $params ) {
441 - list( $c, $source ) = $this->resolveStoragePath( $params['source'] );
 441+ list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
442442 if ( $source === null ) {
443443 return null;
444444 }
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php
@@ -68,9 +68,9 @@
6969 * <code>
7070 * $ops = array(
7171 * array(
72 - * 'op' => 'store',
73 - * 'source' => '/tmp/uploads/picture.png',
74 - * 'dest' => 'mwstore://container/uploadedFilename.png'
 72+ * 'op' => 'store',
 73+ * 'src' => '/tmp/uploads/picture.png',
 74+ * 'dst' => 'mwstore://container/uploadedFilename.png'
7575 * )
7676 * );
7777 * </code>
@@ -97,7 +97,7 @@
9898 * that don't yet exists or, on FS backends, create parent directories.
9999 * Do not call this function from places outside FileBackend and FileOp.
100100 * $params include:
101 - * directory : storage directory
 101+ * dir : storage directory
102102 *
103103 * @param Array $params
104104 * @return Status
@@ -109,7 +109,7 @@
110110 * This is not guaranteed to actually do anything.
111111 * Do not call this function from places outside FileBackend and FileOp.
112112 * $params include:
113 - * directory : storage directory
 113+ * dir : storage directory
114114 * noAccess : try to deny file access
115115 * noListing : try to deny file listing
116116 *
@@ -123,7 +123,7 @@
124124 * On FS backends, the directory will be deleted. Others may do nothing.
125125 * Do not call this function from places outside FileBackend and FileOp.
126126 * $params include:
127 - * directory : storage directory
 127+ * dir : storage directory
128128 *
129129 * @param Array $params
130130 * @return Status
@@ -134,7 +134,7 @@
135135 * Check if a file exits at a storage path in the backend.
136136 * Do not call this function from places outside FileBackend and FileOp.
137137 * $params include:
138 - * source : source storage path
 138+ * src : source storage path
139139 *
140140 * @param Array $params
141141 * @return bool
@@ -145,7 +145,7 @@
146146 * Get a hash of the file at a storage path in the backend.
147147 * Typically this will be a SHA-1 hash, MD5 hash, or something similar.
148148 * $params include:
149 - * source : source storage path
 149+ * src : source storage path
150150 *
151151 * @param Array $params
152152 * @return string|false Hash string or false on failure
@@ -162,7 +162,7 @@
163163 /**
164164 * Get the last-modified timestamp of the file at a storage path.
165165 * $params include:
166 - * source : source storage path
 166+ * src : source storage path
167167 *
168168 * @param Array $params
169169 * @return string|false TS_MW timestamp or false on failure
@@ -173,7 +173,7 @@
174174 * Get the properties of the file at a storage path in the backend.
175175 * Returns FSFile::placeholderProps() on failure.
176176 * $params include:
177 - * source : source storage path
 177+ * src : source storage path
178178 *
179179 * @param Array $params
180180 * @return Array
@@ -186,7 +186,7 @@
187187 * must be sent if streaming began, while none should be sent otherwise.
188188 * Implementations should flush the output buffer before sending data.
189189 * $params include:
190 - * source : source storage path
 190+ * src : source storage path
191191 *
192192 * @param Array $params
193193 * @return Status
@@ -200,7 +200,7 @@
201201 * then all items under that container directory should be listed.
202202 * Results should be storage paths relative to the given directory.
203203 * $params include:
204 - * directory : storage path directory.
 204+ * dir : storage path directory.
205205 *
206206 * @return Iterator|Array
207207 */
@@ -210,7 +210,7 @@
211211 * Get a local copy on disk of the file at a storage path in the backend.
212212 * The temporary copy should have the same file extension as the source.
213213 * $params include:
214 - * source : source storage path
 214+ * src : source storage path
215215 *
216216 * @param Array $params
217217 * @return TempFSFile|null Temporary file or null on failure
@@ -253,8 +253,8 @@
254254 * Store a file into the backend from a file on disk.
255255 * Do not call this function from places outside FileBackend and FileOp.
256256 * $params include:
257 - * source : source path on disk
258 - * dest : destination storage path
 257+ * src : source path on disk
 258+ * dst : destination storage path
259259 * overwriteDest : do nothing and pass if an identical file exists at destination
260260 *
261261 * @param Array $params
@@ -266,8 +266,8 @@
267267 * Copy a file from one storage path to another in the backend.
268268 * Do not call this function from places outside FileBackend and FileOp.
269269 * $params include:
270 - * source : source storage path
271 - * dest : destination storage path
 270+ * src : source storage path
 271+ * dst : destination storage path
272272 * overwriteDest : do nothing and pass if an identical file exists at destination
273273 *
274274 * @param Array $params
@@ -280,8 +280,8 @@
281281 * This can be left as a dummy function as long as hasMove() returns false.
282282 * Do not call this function from places outside FileBackend and FileOp.
283283 * $params include:
284 - * source : source storage path
285 - * dest : destination storage path
 284+ * src : source storage path
 285+ * dst : destination storage path
286286 * overwriteDest : do nothing and pass if an identical file exists at destination
287287 *
288288 * @param Array $params
@@ -295,7 +295,7 @@
296296 * Delete a file at the storage path.
297297 * Do not call this function from places outside FileBackend and FileOp.
298298 * $params include:
299 - * source : source storage path
 299+ * src : source storage path
300300 *
301301 * @param Array $params
302302 * @return Status
@@ -306,8 +306,8 @@
307307 * Combines files from severals storage paths into a new file in the backend.
308308 * Do not call this function from places outside FileBackend and FileOp.
309309 * $params include:
310 - * source : source storage path
311 - * dest : destination storage path
 310+ * src : source storage path
 311+ * dst : destination storage path
312312 * overwriteDest : do nothing and pass if an identical file exists at destination
313313 *
314314 * @param Array $params
@@ -320,7 +320,7 @@
321321 * Do not call this function from places outside FileBackend and FileOp.
322322 * $params include:
323323 * contents : the raw file contents
324 - * dest : destination storage path
 324+ * dst : destination storage path
325325 * overwriteDest : do nothing and pass if an identical file exists at destination
326326 *
327327 * @param Array $params
@@ -346,8 +346,8 @@
347347 * For example, moving objects accross containers may not be supported.
348348 * Do not call this function from places outside FileBackend and FileOp.
349349 * $params include:
350 - * source : source storage path
351 - * dest : destination storage path
 350+ * src : source storage path
 351+ * dst : destination storage path
352352 *
353353 * @param Array $params
354354 * @return bool
Index: branches/FileBackend/phase3/includes/filerepo/FileRepo.php
@@ -116,7 +116,7 @@
117117 if ( $doZones && !in_array( $zone, $doZones ) ) {
118118 continue;
119119 }
120 - $params = array( 'directory' => $this->getZonePath( $zone ) );
 120+ $params = array( 'dir' => $this->getZonePath( $zone ) );
121121 $status->merge( $this->backend->prepare( $params ) );
122122 }
123123 return $status;
@@ -131,9 +131,9 @@
132132 protected function initDeletedDir( $dir ) {
133133 // Add a .htaccess file to the root of the deleted zone
134134 $root = $this->getZonePath( 'deleted' );
135 - $this->backend->secure( array( 'directory' => $root, 'noAccess' => true ) );
 135+ $this->backend->secure( array( 'dir' => $root, 'noAccess' => true ) );
136136 // Seed new directories with a blank index.html, to prevent crawling
137 - $this->backend->secure( array( 'directory' => $dir, 'noListing' => true ) );
 137+ $this->backend->secure( array( 'dir' => $dir, 'noListing' => true ) );
138138 }
139139
140140 /**
@@ -656,7 +656,7 @@
657657 $dstDir = dirname( $dstPath );
658658
659659 // Create destination directories for this triplet
660 - if ( !$backend->prepare( array( 'directory' => $dstDir ) )->isOK() ) {
 660+ if ( !$backend->prepare( array( 'dir' => $dstDir ) )->isOK() ) {
661661 return $this->newFatal( 'directorycreateerror', $dstDir );
662662 }
663663
@@ -680,8 +680,8 @@
681681 }
682682 $operations[] = array(
683683 'op' => $opName,
684 - 'source' => $srcPath,
685 - 'dest' => $dstPath,
 684+ 'src' => $srcPath,
 685+ 'dst' => $dstPath,
686686 'overwriteDest' => $flags & self::OVERWRITE,
687687 'overwriteSame' => $flags & self::OVERWRITE_SAME,
688688 'ignoreErrors' => true
@@ -730,7 +730,7 @@
731731 if ( FileBackend::isStoragePath( $path ) ) {
732732 $operations[] = array(
733733 'op' => 'delete',
734 - 'source' => $path,
 734+ 'src' => $path,
735735 'ignoreErrors' => true
736736 );
737737 } else {
@@ -780,7 +780,7 @@
781781 return false;
782782 }
783783 $path = $this->resolveVirtualUrl( $virtualUrl );
784 - $op = array( 'op' => 'delete', 'source' => $path );
 784+ $op = array( 'op' => 'delete', 'src' => $path );
785785 $status = $this->backend->doOperation( $op );
786786 return $status->isOK();
787787 }
@@ -854,28 +854,28 @@
855855 $dstDir = dirname( $dstPath );
856856 $archiveDir = dirname( $archivePath );
857857 // Abort immediately on directory creation errors since they're likely to be repetitive
858 - if ( !$backend->prepare( array( 'directory' => $dstDir ) )->isOK() ) {
 858+ if ( !$backend->prepare( array( 'dir' => $dstDir ) )->isOK() ) {
859859 return $this->newFatal( 'directorycreateerror', $dstDir );
860860 }
861 - if ( !$backend->prepare( array( 'directory' => $archiveDir ) )->isOK() ) {
 861+ if ( !$backend->prepare( array( 'dir' => $archiveDir ) )->isOK() ) {
862862 return $this->newFatal( 'directorycreateerror', $archiveDir );
863863 }
864864
865865 // Archive destination file if it exists
866 - if ( $backend->fileExists( array( 'source' => $dstPath ) ) ) {
 866+ if ( $backend->fileExists( array( 'src' => $dstPath ) ) ) {
867867 // Check if the archive file exists
868868 // This is a sanity check to avoid data loss. In UNIX, the rename primitive
869869 // unlinks the destination file if it exists. DB-based synchronisation in
870870 // publishBatch's caller should prevent races. In Windows there's no
871871 // problem because the rename primitive fails if the destination exists.
872 - if ( $backend->fileExists( array( 'source' => $archivePath ) ) ) {
 872+ if ( $backend->fileExists( array( 'src' => $archivePath ) ) ) {
873873 $operations[] = array( 'op' => 'null' );
874874 continue;
875875 } else {
876876 $operations[] = array(
877877 'op' => 'move',
878 - 'source' => $dstPath,
879 - 'dest' => $archivePath,
 878+ 'src' => $dstPath,
 879+ 'dst' => $archivePath,
880880 'ignoreErrors' => true
881881 );
882882 }
@@ -888,23 +888,23 @@
889889 if ( $flags & self::DELETE_SOURCE ) {
890890 $operations[] = array(
891891 'op' => 'move',
892 - 'source' => $srcPath,
893 - 'dest' => $dstPath,
 892+ 'src' => $srcPath,
 893+ 'dst' => $dstPath,
894894 'ignoreErrors' => true
895895 );
896896 } else {
897897 $operations[] = array(
898898 'op' => 'copy',
899 - 'source' => $srcPath,
900 - 'dest' => $dstPath,
 899+ 'src' => $srcPath,
 900+ 'dst' => $dstPath,
901901 'ignoreErrors' => true
902902 );
903903 }
904904 } else { // FS source path
905905 $operations[] = array(
906906 'op' => 'store',
907 - 'source' => $srcPath,
908 - 'dest' => $dstPath,
 907+ 'src' => $srcPath,
 908+ 'dst' => $dstPath,
909909 'ignoreErrors' => true
910910 );
911911 if ( $flags & self::DELETE_SOURCE ) {
@@ -956,7 +956,7 @@
957957 $file = $this->resolveVirtualUrl( $file );
958958 }
959959 if ( FileBackend::isStoragePath( $file ) ) {
960 - $result[$key] = $this->backend->fileExists( array( 'source' => $file ) );
 960+ $result[$key] = $this->backend->fileExists( array( 'src' => $file ) );
961961 } else {
962962 if ( $flags & self::FILES_ONLY ) {
963963 $result[$key] = is_file( $file ); // FS only
@@ -1033,21 +1033,21 @@
10341034 $archiveDir = dirname( $archivePath ); // does not touch FS
10351035
10361036 // Create destination directories
1037 - if ( !$backend->prepare( array( 'directory' => $archiveDir ) )->isOK() ) {
 1037+ if ( !$backend->prepare( array( 'dir' => $archiveDir ) )->isOK() ) {
10381038 return $this->newFatal( 'directorycreateerror', $archiveDir );
10391039 }
10401040 $this->initDeletedDir( $archiveDir );
10411041
1042 - if ( $backend->fileExists( array( 'source' => $archivePath ) ) ) {
 1042+ if ( $backend->fileExists( array( 'src' => $archivePath ) ) ) {
10431043 $operations[] = array(
1044 - 'op' => 'delete',
1045 - 'source' => $srcPath
 1044+ 'op' => 'delete',
 1045+ 'src' => $srcPath
10461046 );
10471047 } else {
10481048 $operations[] = array(
1049 - 'op' => 'move',
1050 - 'source' => $srcPath,
1051 - 'dest' => $archivePath
 1049+ 'op' => 'move',
 1050+ 'src' => $srcPath,
 1051+ 'dst' => $archivePath
10521052 );
10531053 }
10541054 }
@@ -1096,7 +1096,7 @@
10971097 */
10981098 public function getLocalCopy( $virtualUrl ) {
10991099 $path = $this->resolveToStoragePath( $virtualUrl );
1100 - return $this->backend->getLocalCopy( array( 'source' => $path ) );
 1100+ return $this->backend->getLocalCopy( array( 'src' => $path ) );
11011101 }
11021102
11031103 /**
@@ -1108,7 +1108,7 @@
11091109 */
11101110 public function getFileProps( $virtualUrl ) {
11111111 $path = $this->resolveToStoragePath( $virtualUrl );
1112 - return $this->backend->getFileProps( array( 'source' => $path ) );
 1112+ return $this->backend->getFileProps( array( 'src' => $path ) );
11131113 }
11141114
11151115 /**
@@ -1119,7 +1119,7 @@
11201120 */
11211121 public function getFileTimestamp( $virtualUrl ) {
11221122 $path = $this->resolveToStoragePath( $virtualUrl );
1123 - return $this->backend->getFileTimestamp( array( 'source' => $path ) );
 1123+ return $this->backend->getFileTimestamp( array( 'src' => $path ) );
11241124 }
11251125
11261126 /**
@@ -1130,7 +1130,7 @@
11311131 */
11321132 public function getFileSha1( $virtualUrl ) {
11331133 $path = $this->resolveToStoragePath( $virtualUrl );
1134 - $tmpFile = $this->backend->getLocalCopy( array( 'source' => $path ) );
 1134+ $tmpFile = $this->backend->getLocalCopy( array( 'src' => $path ) );
11351135 if ( !$tmpFile ) {
11361136 return false;
11371137 }
@@ -1166,7 +1166,7 @@
11671167 for ( $hexPos = 0; $hexPos < $this->hashLevels; $hexPos++ ) {
11681168 $path .= '/' . substr( $hexString, 0, $hexPos + 1 );
11691169 }
1170 - $iterator = $this->backend->getFileList( array( 'directory' => $path ) );
 1170+ $iterator = $this->backend->getFileList( array( 'dir' => $path ) );
11711171 foreach ( $iterator as $name ) {
11721172 // Each item returned is a public file
11731173 call_user_func( $callback, "{$path}/{$name}" );
Index: branches/FileBackend/phase3/includes/media/Generic.php
@@ -218,7 +218,7 @@
219219 // Note: no file is created if it's to be rendered client-side.
220220 if ( !$out->isError() && filesize( $tmpDest ) ) {
221221 $op = array( 'op' => 'store',
222 - 'source' => $tmpDest, 'dest' => $dstPath, 'overwriteDest' => true );
 222+ 'src' => $tmpDest, 'dst' => $dstPath, 'overwriteDest' => true );
223223 if ( !$image->getRepo()->getBackend()->doOperation( $op )->isOK() ) {
224224 return new MediaTransformError( 'thumbnail_error',
225225 $params['width'], 0, wfMsg( 'thumbnail-dest-create' ) );

Status & tagging log