protected function doPrecheck( array &$predicates ) {
$status = StatusValue::newGood();
- // Check if the source file exists
- if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
+
+ // Check source file existence
+ $srcExists = $this->fileExists( $this->params['src'], $predicates );
+ if ( $srcExists === false ) {
if ( $this->getParam( 'ignoreMissingSource' ) ) {
$this->doOperation = false; // no-op
// Update file existence predicates (cache 404s)
return $status;
}
- // Check if a file can be placed/changed at the destination
- } elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
- $status->fatal( 'backend-fail-usable', $this->params['dst'] );
- $status->fatal( 'backend-fail-move', $this->params['src'], $this->params['dst'] );
+ } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
+ $status->fatal( 'backend-fail-stat', $this->params['src'] );
return $status;
}
- // Check if destination file exists
+ // Check if an incompatible destination file exists
$status->merge( $this->precheckDestExistence( $predicates ) );
$this->params['dstExists'] = $this->destExists; // see FileBackendStore::setFileCache()
if ( $status->isOK() ) {