Skip to content
Snippets Groups Projects

#2928904 Added media target

Open Ivan Duarte requested to merge issue/feeds-2928904:2928904-media-target into 8.x-3.x
Files
27
+ 5
2
@@ -211,7 +211,7 @@ class File extends EntityReference {
@@ -211,7 +211,7 @@ class File extends EntityReference {
}
}
// Compose file path.
// Compose file path.
$filepath = $this->getDestinationDirectory() . '/' . $this->getFileName($value);
$filepath = $this->getDestinationDirectory($value) . '/' . $this->getFileName($value);
switch ($this->configuration['existing']) {
switch ($this->configuration['existing']) {
case FileSystemInterface::EXISTS_ERROR:
case FileSystemInterface::EXISTS_ERROR:
@@ -240,10 +240,13 @@ class File extends EntityReference {
@@ -240,10 +240,13 @@ class File extends EntityReference {
/**
/**
* Prepares destination directory and returns its path.
* Prepares destination directory and returns its path.
*
*
 
* @param string $url
 
* The URL of file.
 
*
* @return string
* @return string
* The directory to save the file to.
* The directory to save the file to.
*/
*/
protected function getDestinationDirectory() {
protected function getDestinationDirectory($url) {
$destination = $this->token->replace($this->settings['uri_scheme'] . '://' . trim($this->settings['file_directory'], '/'));
$destination = $this->token->replace($this->settings['uri_scheme'] . '://' . trim($this->settings['file_directory'], '/'));
$this->fileSystem->prepareDirectory($destination, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY);
$this->fileSystem->prepareDirectory($destination, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY);
return $destination;
return $destination;
Loading