32 [
'overwrite',
'overwriteSame',
'ignoreMissingSource',
'headers' ],
38 $status = StatusValue::newGood();
41 $srcExists = $this->
fileExists( $this->params[
'src'], $predicates );
42 if ( $srcExists ===
false ) {
43 if ( $this->
getParam(
'ignoreMissingSource' ) ) {
44 $this->cancelled =
true;
52 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
56 } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
57 $status->fatal(
'backend-fail-stat', $this->params[
'src'] );
66 if ( $status->isOK() ) {
76 if ( $this->overwriteSameCase ) {
77 $status = StatusValue::newGood();
78 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
80 $headers = $this->
getParam(
'headers' ) ?: [];
81 $status = $this->backend->describeInternal( $this->
setFlags( [
82 'src' => $this->params[
'dst'],
'headers' => $headers
86 $status = $this->backend->copyInternal( $this->
setFlags( $this->params ) );
93 return [ $this->params[
'src'] ];
97 return [ $this->params[
'dst'] ];
Copy a file from one storage path to another in the backend.
doPrecheck(array &$predicates)
allowedParams()
Get the file operation parameters.
storagePathsChanged()
Get a list of storage paths written to for this operation.
storagePathsRead()
Get a list of storage paths read from for this operation.
FileBackend helper class for representing operations.
fileExists( $source, array $predicates)
Check if a file will exist in storage when this operation is attempted.
getParam( $name)
Get the value of the parameter with the given name.
setFlags(array $params)
Adjust params to FileBackendStore internal file calls.
precheckDestExistence(array $predicates)
Check for errors with regards to the destination file already existing.