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 );
90 if ( $this->overwriteSameCase ) {
91 $status = StatusValue::newGood();
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->copyInternal( $this->
setFlags( $this->params ) );
107 return [ $this->params[
'src'] ];
111 return [ $this->params[
'dst'] ];
116class_alias( CopyFileOp::class,
'CopyFileOp' );
Generic operation result class Has warning/error list, boolean status and arbitrary value.