24 [
'overwrite',
'overwriteSame',
'ignoreMissingSource',
'headers' ],
34 $status = StatusValue::newGood();
38 if ( $srcExists ===
false ) {
39 if ( $this->
getParam(
'ignoreMissingSource' ) ) {
46 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
50 } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
51 $status->fatal(
'backend-fail-stat', $this->params[
'src'] );
56 $srcSize =
function () use ( $opPredicates ) {
58 $size ??= $this->
resolveFileSize( $this->params[
'src'], $opPredicates );
61 $srcSha1 =
function () use ( $opPredicates ) {
70 if ( $status->isOK() ) {
71 $batchPredicates->
assumeFileExists( $this->params[
'dst'], $srcSize, $srcSha1 );
72 if ( $this->params[
'src'] !== $this->params[
'dst'] ) {
82 if ( $this->overwriteSameCase ) {
83 if ( $this->params[
'src'] === $this->params[
'dst'] ) {
85 $status = StatusValue::newGood();
88 $status = $this->backend->deleteInternal( $this->
setFlags(
89 [
'src' => $this->params[
'src'] ]
92 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
94 $headers = $this->
getParam(
'headers' ) ?: [];
95 $status = $this->backend->describeInternal( $this->
setFlags(
96 [
'src' => $this->params[
'dst'],
'headers' => $headers ]
100 $status = $this->backend->moveInternal( $this->
setFlags( $this->params ) );
108 return [ $this->params[
'src'] ];
113 return [ $this->params[
'src'], $this->params[
'dst'] ];
118class_alias( MoveFileOp::class,
'MoveFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.