'op' => $opName,
'src' => $srcPath,
'dst' => $dstPath,
- 'overwriteDest' => $flags & self::OVERWRITE,
+ 'overwrite' => $flags & self::OVERWRITE,
'overwriteSame' => $flags & self::OVERWRITE_SAME,
);
}
}
if ( file_exists( $dest ) ) {
- if ( !empty( $params['overwriteDest'] ) ) {
+ if ( !empty( $params['overwrite'] ) ) {
wfSuppressWarnings();
$ok = unlink( $dest );
wfRestoreWarnings();
}
if ( file_exists( $dest ) ) {
- if ( !empty( $params['overwriteDest'] ) ) {
+ if ( !empty( $params['overwrite'] ) ) {
wfSuppressWarnings();
$ok = unlink( $dest );
wfRestoreWarnings();
}
if ( file_exists( $dest ) ) {
- if ( !empty( $params['overwriteDest'] ) ) {
+ if ( !empty( $params['overwrite'] ) ) {
// Windows does not support moving over existing files
if ( wfIsWindows() ) {
wfSuppressWarnings();
}
if ( file_exists( $dest ) ) {
- if ( !empty( $params['overwriteDest'] ) ) {
+ if ( !empty( $params['overwrite'] ) ) {
wfSuppressWarnings();
$ok = unlink( $dest );
wfRestoreWarnings();
* 'op' => 'create',
* 'dst' => <storage path>,
* 'content' => <string of new file contents>,
- * 'overwriteDest' => <boolean>,
+ * 'overwrite' => <boolean>,
* 'overwriteSame' => <boolean>
* )
* b) Copy a file system file into storage
* 'op' => 'store',
* 'src' => <file system path>,
* 'dst' => <storage path>,
- * 'overwriteDest' => <boolean>,
+ * 'overwrite' => <boolean>,
* 'overwriteSame' => <boolean>
* )
* c) Copy a file within storage
* 'op' => 'copy',
* 'src' => <storage path>,
* 'dst' => <storage path>,
- * 'overwriteDest' => <boolean>,
+ * 'overwrite' => <boolean>,
* 'overwriteSame' => <boolean>
* )
* d) Move a file within storage
* 'op' => 'move',
* 'src' => <storage path>,
* 'dst' => <storage path>,
- * 'overwriteDest' => <boolean>,
+ * 'overwrite' => <boolean>,
* 'overwriteSame' => <boolean>
* )
* e) Delete a file within storage
* Boolean flags for operations (operation-specific):
* 'ignoreMissingSource' : The operation will simply succeed and do
* nothing if the source file does not exist.
- * 'overwriteDest' : Any destination file will be overwritten.
+ * 'overwrite' : Any destination file will be overwritten.
* 'overwriteSame' : An error will not be given if a file already
* exists at the destination that has the same
* contents as the new contents to be written there.
* $params include:
* content : the raw file contents
* dst : destination storage path
- * overwriteDest : overwrite any file that exists at the destination
+ * overwrite : overwrite any file that exists at the destination
*
* @param $params Array
* @return Status
* $params include:
* src : source path on disk
* dst : destination storage path
- * overwriteDest : overwrite any file that exists at the destination
+ * overwrite : overwrite any file that exists at the destination
*
* @param $params Array
* @return Status
* $params include:
* src : source storage path
* dst : destination storage path
- * overwriteDest : overwrite any file that exists at the destination
+ * overwrite : overwrite any file that exists at the destination
*
* @param $params Array
* @return Status
* $params include:
* src : source storage path
* dst : destination storage path
- * overwriteDest : overwrite any file that exists at the destination
+ * overwrite : overwrite any file that exists at the destination
*
* @param $params Array
* @return Status
}
$this->destSameAsSource = false;
if ( $this->fileExists( $this->params['dst'], $predicates ) ) {
- if ( $this->getParam( 'overwriteDest' ) ) {
+ if ( $this->getParam( 'overwrite' ) ) {
return $status; // OK
} elseif ( $this->getParam( 'overwriteSame' ) ) {
$dhash = $this->fileSha1( $this->params['dst'], $predicates );
* Parameters similar to FileBackend::storeInternal(), which include:
* src : source path on file system
* dst : destination storage path
- * overwriteDest : do nothing and pass if an identical file exists at destination
+ * overwrite : do nothing and pass if an identical file exists at destination
* overwriteSame : override any existing file at destination
*/
class StoreFileOp extends FileOp {
protected function allowedParams() {
- return array( 'src', 'dst', 'overwriteDest', 'overwriteSame' );
+ return array( 'src', 'dst', 'overwrite', 'overwriteSame' );
}
protected function doPrecheck( array &$predicates ) {
* Parameters similar to FileBackend::createInternal(), which include:
* content : a string of raw file contents
* dst : destination storage path
- * overwriteDest : do nothing and pass if an identical file exists at destination
+ * overwrite : do nothing and pass if an identical file exists at destination
* overwriteSame : override any existing file at destination
*/
class CreateFileOp extends FileOp {
protected function allowedParams() {
- return array( 'content', 'dst', 'overwriteDest', 'overwriteSame' );
+ return array( 'content', 'dst', 'overwrite', 'overwriteSame' );
}
protected function doPrecheck( array &$predicates ) {
* Parameters similar to FileBackend::copyInternal(), which include:
* src : source storage path
* dst : destination storage path
- * overwriteDest : do nothing and pass if an identical file exists at destination
+ * overwrite : do nothing and pass if an identical file exists at destination
* overwriteSame : override any existing file at destination
*/
class CopyFileOp extends FileOp {
protected function allowedParams() {
- return array( 'src', 'dst', 'overwriteDest', 'overwriteSame' );
+ return array( 'src', 'dst', 'overwrite', 'overwriteSame' );
}
protected function doPrecheck( array &$predicates ) {
* Parameters similar to FileBackend::moveInternal(), which include:
* src : source storage path
* dst : destination storage path
- * overwriteDest : do nothing and pass if an identical file exists at destination
+ * overwrite : do nothing and pass if an identical file exists at destination
* overwriteSame : override any existing file at destination
*/
class MoveFileOp extends FileOp {
protected function allowedParams() {
- return array( 'src', 'dst', 'overwriteDest', 'overwriteSame' );
+ return array( 'src', 'dst', 'overwrite', 'overwriteSame' );
}
protected function doPrecheck( array &$predicates ) {
// (a) Check the destination container and object
try {
$dContObj = $this->getContainer( $dstCont );
- if ( empty( $params['overwriteDest'] ) ) {
+ if ( empty( $params['overwrite'] ) ) {
$destObj = $dContObj->create_object( $dstRel );
// Check if the object already exists (fields populated)
if ( $destObj->last_modified ) {
// (a) Check the destination container and object
try {
$dContObj = $this->getContainer( $dstCont );
- if ( empty( $params['overwriteDest'] ) ) {
+ if ( empty( $params['overwrite'] ) ) {
$destObj = $dContObj->create_object( $dstRel );
// Check if the object already exists (fields populated)
if ( $destObj->last_modified ) {
try {
$sContObj = $this->getContainer( $srcCont );
$dContObj = $this->getContainer( $dstCont );
- if ( empty( $params['overwriteDest'] ) ) {
+ if ( empty( $params['overwrite'] ) ) {
$destObj = $dContObj->create_object( $dstRel );
// Check if the object already exists (fields populated)
if ( $destObj->last_modified ) {
// FileRepo::store(); getThumbPath() uses a different zone in some subclasses.
$backend->prepare( array( 'dir' => dirname( $thumbPath ) ) );
$status = $backend->store(
- array( 'src' => $tmpThumbPath, 'dst' => $thumbPath, 'overwriteDest' => 1 ),
+ array( 'src' => $tmpThumbPath, 'dst' => $thumbPath, 'overwrite' => 1 ),
array( 'force' => 1, 'nonLocking' => 1, 'allowStale' => 1 )
);
if ( $status->isOK() ) {
$toPath, // dest
);
- $op['overwriteDest'] = true;
+ $op['overwrite'] = true;
$cases[] = array(
$op, // operation
$tmpName, // source
$dest, // dest
);
- $op['overwriteDest'] = true;
+ $op['overwrite'] = true;
$cases[] = array(
$op, // operation
$source, // source
$dest, // dest
);
- $op['overwriteDest'] = true;
+ $op['overwrite'] = true;
$cases[] = array(
$op, // operation
$source, // source
strlen( $dummyText )
);
- $op['overwriteDest'] = true;
+ $op['overwrite'] = true;
$cases[] = array(
$op, // operation
$source, // source
$this->backend->create( array( 'dst' => $fileC, 'content' => $fileCContents ) );
$status = $this->backend->doOperations( array(
- array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwriteDest' => 1 ),
+ array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC, 'overwrite' => 1 ),
// Now: A:<A>, B:<B>, C:<A>, D:<D> (file:<orginal contents>)
array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileA, 'overwriteSame' => 1 ),
// Now: A:<A>, B:<B>, C:<A>, D:<D>
- array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwriteDest' => 1 ),
+ array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileD, 'overwrite' => 1 ),
// Now: A:<A>, B:<B>, C:<empty>, D:<A>
array( 'op' => 'move', 'src' => $fileB, 'dst' => $fileC ),
// Now: A:<A>, B:<empty>, C:<B>, D:<A>
array( 'op' => 'move', 'src' => $fileD, 'dst' => $fileA, 'overwriteSame' => 1 ),
// Now: A:<A>, B:<empty>, C:<B>, D:<empty>
- array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwriteDest' => 1 ),
+ array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileA, 'overwrite' => 1 ),
// Now: A:<B>, B:<empty>, C:<empty>, D:<empty>
array( 'op' => 'copy', 'src' => $fileA, 'dst' => $fileC ),
// Now: A:<B>, B:<empty>, C:<B>, D:<empty>
array( 'op' => 'move', 'src' => $fileA, 'dst' => $fileC, 'overwriteSame' => 1 ),
// Now: A:<empty>, B:<empty>, C:<B>, D:<empty>
- array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteDest' => 1 ),
+ array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ),
// Does nothing
array( 'op' => 'copy', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ),
// Does nothing
- array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteDest' => 1 ),
+ array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwrite' => 1 ),
// Does nothing
array( 'op' => 'move', 'src' => $fileC, 'dst' => $fileC, 'overwriteSame' => 1 ),
// Does nothing