Skip to content
Snippets Groups Projects

Ensure the resolved local path is used when getting the file.

1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -18,7 +18,7 @@ class Storage {
*
* @var string
*/
const LOCAL_FOLDER = 'private://data_pipelines_sftp/cache';
const string LOCAL_FOLDER = 'private://data_pipelines_sftp/cache';
/**
* A method to get the local path for storage.
@@ -99,8 +99,9 @@ class Storage {
* The resource of the local file.
*/
public function getLocalCopy(string $path): mixed {
if (is_readable($this->getLocalPath($path))) {
if ($stream = fopen($path, 'r')) {
$local_path = $this->getLocalPath($path);
if (is_readable($local_path)) {
if ($stream = fopen($local_path, 'r')) {
rewind($stream);
return $stream;
}
Loading