private function getFileFromDisk($directory, $source)
    {
        $hash = 'DISK-'.\md5(\realpath($source));
        if (!\array_key_exists($hash, $this->files)) {
            // Check if source is a directory or a file.
            if (\is_dir($source)) {
                $this->fs->mirror($source, $directory.'/'.$hash, null, ['copy_on_windows' => true]);
            } else {
                $this->fs->copy($source, $directory.'/'.$hash);
            }

            $this->files[$hash] = $hash;
        }

        return $this->files[$hash];
    }
private function getFileFromDisk($directory, $source)
    {
        $hash = 'DISK-'.\md5(\realpath($source));
        if (!\array_key_exists($hash, $this->files)) {
            // Check if source is a directory or a file.
            if (\is_dir($source)) {
                $this->fs->mirror($source, $directory.'/'.$hash, null, ['copy_on_windows' => true]);
            } else {
                $this->fs->copy($source, $directory.'/'.$hash);
            }

            $this->files[$hash] = $hash;
        }

        return $this->files[$hash];
    }
private function getFileFromDisk ( $ directory , $ source ) { $ hash = 'DISK-' . \ md5 ( \ realpath ( $ source ) ) ; if ( ! \ array_key_exists ( $ hash , $ this -> files ) ) { // Check if source is a directory or a file. if ( \ is_dir ( $ source ) ) { $ this -> fs -> mirror ( $ source , $ directory . '/' . $ hash , null , [ 'copy_on_windows' => true ] ) ; } else { $ this -> fs -> copy ( $ source , $ directory . '/' . $ hash ) ; } $ this -> files [ $ hash ] = $ hash ; } return $ this -> files [ $ hash ] ; }
Generated a file in a directory from an existing file.

@param string $directory Targeted directory
@param string $source    Path to the source file

@return string Name of file generated
Generated a file in a directory from an existing file .