24 [
'overwrite',
'overwriteSame',
'ignoreMissingSource',
'headers' ],
34 $status = StatusValue::newGood();
36 if ( !$this->backend->isPathUsableInternal( $this->params[
'dst'] ) ) {
37 $status->fatal(
'backend-fail-usable', $this->params[
'dst'] );
43 !$this->
getParam(
'ignoreMissingSource' ) &&
44 !$this->backend->isPathUsableInternal( $this->params[
'src'] )
46 $status->fatal(
'backend-fail-usable', $this->params[
'src'] );
53 if ( $srcExists ===
false ) {
54 if ( $this->
getParam(
'ignoreMissingSource' ) ) {
61 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
65 } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
66 $status->fatal(
'backend-fail-stat', $this->params[
'src'] );
71 $srcSize =
function () use ( $opPredicates ) {
73 $size ??= $this->
resolveFileSize( $this->params[
'src'], $opPredicates );
76 $srcSha1 =
function () use ( $opPredicates ) {
85 if ( $status->isOK() ) {
86 $batchPredicates->
assumeFileExists( $this->params[
'dst'], $srcSize, $srcSha1 );
87 if ( $this->params[
'src'] !== $this->params[
'dst'] ) {
97 if ( $this->overwriteSameCase ) {
98 if ( $this->params[
'src'] === $this->params[
'dst'] ) {
100 $status = StatusValue::newGood();
103 $status = $this->backend->deleteInternal( $this->
setFlags(
104 [
'src' => $this->params[
'src'] ]
107 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
109 $headers = $this->
getParam(
'headers' ) ?: [];
110 $status = $this->backend->describeInternal( $this->
setFlags(
111 [
'src' => $this->params[
'dst'],
'headers' => $headers ]
115 $status = $this->backend->moveInternal( $this->
setFlags( $this->params ) );
123 return [ $this->params[
'src'] ];
128 return [ $this->params[
'src'], $this->params[
'dst'] ];
133class_alias( MoveFileOp::class,
'MoveFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.