Commit e3aa75b9 authored by larowlan's avatar larowlan

Issue #3033942 by vadim.hirbu, RichardDavies: Clean up comments in FileSystem

parent fc301d85
......@@ -314,7 +314,6 @@ public function validScheme($scheme) {
public function copy($source, $destination, $replace = self::EXISTS_RENAME) {
$this->prepareDestination($source, $destination, $replace);
// Perform the copy operation.
if (!@copy($source, $destination)) {
// If the copy failed and realpaths exist, retry the operation using them
// instead.
......@@ -463,7 +462,6 @@ public function move($source, $destination, $replace = self::EXISTS_RENAME) {
protected function prepareDestination($source, &$destination, $replace) {
$original_source = $source;
// Assert that the source file actually exists.
if (!file_exists($source)) {
if (($realpath = $this->realpath($original_source)) !== FALSE) {
$this->logger->error("File '%original_source' ('%realpath') could not be copied because it does not exist.", [
......@@ -544,7 +542,6 @@ public function prepareDirectory(&$directory, $options = self::MODIFY_PERMISSION
$directory = rtrim($directory, '/\\');
}
// Check if directory exists.
if (!is_dir($directory)) {
// Let mkdir() recursively create directories and use the default
// directory permissions.
......@@ -553,7 +550,7 @@ public function prepareDirectory(&$directory, $options = self::MODIFY_PERMISSION
}
return FALSE;
}
// The directory exists, so check to see if it is writable.
$writable = is_writable($directory);
if (!$writable && ($options & static::MODIFY_PERMISSIONS)) {
return $this->chmod($directory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment