37 [
'overwrite',
'overwriteSame',
'ignoreMissingSource',
'headers' ],
46 $status = StatusValue::newGood();
50 if ( $srcExists ===
false ) {
51 if ( $this->
getParam(
'ignoreMissingSource' ) ) {
58 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
62 } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
63 $status->fatal(
'backend-fail-stat', $this->params[
'src'] );
68 $srcSize =
function () use ( $opPredicates ) {
70 $size ??= $this->
resolveFileSize( $this->params[
'src'], $opPredicates );
73 $srcSha1 =
function () use ( $opPredicates ) {
82 if ( $status->isOK() ) {
83 $batchPredicates->
assumeFileExists( $this->params[
'dst'], $srcSize, $srcSha1 );
84 if ( $this->params[
'src'] !== $this->params[
'dst'] ) {
93 if ( $this->overwriteSameCase ) {
94 if ( $this->params[
'src'] === $this->params[
'dst'] ) {
96 $status = StatusValue::newGood();
99 $status = $this->backend->deleteInternal( $this->
setFlags(
100 [
'src' => $this->params[
'src'] ]
103 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
105 $headers = $this->
getParam(
'headers' ) ?: [];
106 $status = $this->backend->describeInternal( $this->
setFlags(
107 [
'src' => $this->params[
'dst'],
'headers' => $headers ]
111 $status = $this->backend->moveInternal( $this->
setFlags( $this->params ) );
118 return [ $this->params[
'src'] ];
122 return [ $this->params[
'src'], $this->params[
'dst'] ];
127class_alias( MoveFileOp::class,
'MoveFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.