1 | <?php |
||
12 | class DefaultFilesystem implements Filesystem |
||
13 | { |
||
14 | /** @var \Illuminate\Contracts\Filesystem\Factory */ |
||
15 | protected $filesystem; |
||
16 | |||
17 | /** @var array */ |
||
18 | protected $customRemoteHeaders = []; |
||
19 | |||
20 | public function __construct(Factory $filesystems) |
||
24 | |||
25 | /* |
||
26 | * Add a file to the mediaLibrary for the given media. |
||
27 | */ |
||
28 | public function add(string $file, Media $media, string $targetFileName = '') |
||
36 | |||
37 | /* |
||
38 | * Copy a file to the medialibrary for the given $media. |
||
39 | */ |
||
40 | public function copyToMediaLibrary(string $file, Media $media, bool $conversions = false, string $targetFileName = '') |
||
58 | |||
59 | /** |
||
60 | * Add custom remote headers on runtime. |
||
61 | * |
||
62 | * @param array $customRemoteHeaders |
||
63 | */ |
||
64 | public function addCustomRemoteHeaders(array $customRemoteHeaders) |
||
68 | |||
69 | /* |
||
70 | * Get the headers to be used when copying the |
||
71 | * given file to a remote filesytem. |
||
72 | */ |
||
73 | public function getRemoteHeadersForFile(string $file) : array |
||
81 | |||
82 | /* |
||
83 | * Copy a file from the medialibrary to the given targetFile. |
||
84 | */ |
||
85 | public function copyFromMediaLibrary(Media $media, string $targetFile): string |
||
97 | |||
98 | /* |
||
99 | * Remove all files for the given media. |
||
100 | */ |
||
101 | public function removeFiles(Media $media) |
||
112 | |||
113 | /* |
||
114 | * Rename a file for the given media. |
||
115 | */ |
||
116 | public function renameFile(Media $media, string $oldName) |
||
123 | |||
124 | /* |
||
125 | * Return the directory where all files of the given media are stored. |
||
126 | */ |
||
127 | public function getMediaDirectory(Media $media, bool $conversion = false) : string |
||
141 | |||
142 | /* |
||
143 | * Return the directory where all conversions of the given media are stored. |
||
144 | */ |
||
145 | public function getConversionDirectory(Media $media) : string |
||
149 | } |
||
150 |