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 );
79 if ( $this->overwriteSameCase ) {
80 $status = StatusValue::newGood();
81 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
83 $headers = $this->
getParam(
'headers' ) ?: [];
84 $status = $this->backend->describeInternal( $this->
setFlags( [
85 'src' => $this->params[
'dst'],
'headers' => $headers
89 $status = $this->backend->copyInternal( $this->
setFlags( $this->params ) );
97 return [ $this->params[
'src'] ];
102 return [ $this->params[
'dst'] ];
107class_alias( CopyFileOp::class,
'CopyFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.