throw new DirectoryNotReadyException("The specified file '
$original_source' could not be copied because the destination directory '
$dirname' is not properly configured. This may be caused by a problem with file or directory permissions."
);
} } // Determine whether we can perform this operation based on overwrite rules.
$destination =
$this->
getDestinationFilename($destination,
$replace);
if ($destination === FALSE
) { $this->logger->
error("File '%original_source' could not be copied because a file by that name already exists in the destination directory ('%destination').",
[ '%original_source' =>
$original_source,
'%destination' =>
$destination,
]);
throw new FileExistsException("File '
$original_source' could not be copied because a file by that name already exists in the destination directory ('
$destination')."
);
} // Assert that the source and destination filenames are not the same.
$real_source =
$this->
realpath($source);
$real_destination =
$this->
realpath($destination);
if ($source ==
$destination || ($real_source !== FALSE
) && ($real_source ==
$real_destination)) { $this->logger->
error("File '%source' could not be copied because it would overwrite itself.",
[ '%source' =>
$source,
]);
throw new FileException("File '
$source' could not be copied because it would overwrite itself."
);
} }