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() ) {
79 if ( $this->overwriteSameCase ) {
80 if ( $this->params[
'src'] === $this->params[
'dst'] ) {
82 $status = StatusValue::newGood();
85 $status = $this->backend->deleteInternal( $this->
setFlags(
86 [
'src' => $this->params[
'src'] ]
89 } elseif ( $this->params[
'src'] === $this->params[
'dst'] ) {
91 $headers = $this->
getParam(
'headers' ) ?: [];
92 $status = $this->backend->describeInternal( $this->
setFlags(
93 [
'src' => $this->params[
'dst'],
'headers' => $headers ]
97 $status = $this->backend->moveInternal( $this->
setFlags( $this->params ) );
104 return [ $this->params[
'src'] ];
108 return [ $this->params[
'src'], $this->params[
'dst'] ];
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.
Move a file from one storage path to another in the backend.
doPrecheck(array &$predicates)
storagePathsRead()
Get a list of storage paths read from for this operation.
allowedParams()
Get the file operation parameters.
storagePathsChanged()
Get a list of storage paths written to for this operation.