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 );
94 if ( $this->overwriteSameCase ) {
95 $status = StatusValue::newGood();
96 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
98 $headers = $this->
getParam(
'headers' ) ?: [];
99 $status = $this->backend->describeInternal( $this->
setFlags( [
100 'src' => $this->params[
'dst'],
'headers' => $headers
104 $status = $this->backend->copyInternal( $this->
setFlags( $this->params ) );
112 return [ $this->params[
'src'] ];
117 return [ $this->params[
'dst'] ];
122class_alias( CopyFileOp::class,
'CopyFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.