else { $this->logger->
error("File '%original_source' could not be copied because it does not exist.",
[ '%original_source' =>
$original_source,
]);
throw new FileNotExistsException("File '
$original_source' could not be copied because it does not exist."
);
} } // Prepare the destination directory.
if ($this->
prepareDirectory($destination)) { // The destination is already a directory, so append the source basename.
$destination =
$this->streamWrapperManager->
normalizeUri($destination . '/' .
$this->
basename($source));
} else { // Perhaps $destination is a dir/file?
$dirname =
$this->
dirname($destination);
if (!
$this->
prepareDirectory($dirname)) { $this->logger->
error("The specified file '%original_source' could not be copied because the destination directory '%destination_directory' is not properly configured. This may be caused by a problem with file or directory permissions.",
[ '%original_source' =>
$original_source,
'%destination_directory' =>
$dirname,
]);
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."
);
} }