1 | <?php |
||
30 | class ServerFactory |
||
31 | { |
||
32 | /** |
||
33 | * Configuration parameters. |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $config; |
||
37 | |||
38 | /** |
||
39 | * Create ServerFactory instance. |
||
40 | * @param array $config Configuration parameters. |
||
41 | */ |
||
42 | public function __construct(array $config = []) |
||
46 | |||
47 | /** |
||
48 | * Get configured server. |
||
49 | * @return Server Configured Glide server. |
||
50 | */ |
||
51 | public function getServer() |
||
70 | |||
71 | /** |
||
72 | * Create local filesystem for Flysystem v1 or v2 |
||
73 | * @param string $path Filesystem path |
||
74 | * @return FilesystemInterface|FilesystemOperator |
||
75 | */ |
||
76 | private function createLocalFilesystem(string $path) |
||
88 | |||
89 | /** |
||
90 | * Get source file system. |
||
91 | * @return FilesystemInterface|FilesystemOperator Source file system. |
||
92 | */ |
||
93 | public function getSource() |
||
105 | |||
106 | /** |
||
107 | * Get source path prefix. |
||
108 | * @return string|null Source path prefix. |
||
109 | */ |
||
110 | public function getSourcePathPrefix() |
||
116 | |||
117 | /** |
||
118 | * Get cache file system. |
||
119 | * @return FilesystemInterface|FilesystemOperator Cache file system. |
||
120 | */ |
||
121 | public function getCache() |
||
133 | |||
134 | /** |
||
135 | * Get cache path prefix. |
||
136 | * @return string|null Cache path prefix. |
||
137 | */ |
||
138 | public function getCachePathPrefix() |
||
144 | |||
145 | /** |
||
146 | * Get the group cache in folders setting. |
||
147 | * @return bool Whether to group cache in folders. |
||
148 | */ |
||
149 | public function getGroupCacheInFolders() |
||
157 | |||
158 | /** |
||
159 | * Get the cache with file extensions setting. |
||
160 | * @return bool Whether to cache with file extensions. |
||
161 | */ |
||
162 | public function getCacheWithFileExtensions() |
||
170 | |||
171 | /** |
||
172 | * Get watermarks file system. |
||
173 | * @return FilesystemInterface|FilesystemOperator|null Watermarks file system. |
||
174 | */ |
||
175 | public function getWatermarks() |
||
187 | |||
188 | /** |
||
189 | * Get watermarks path prefix. |
||
190 | * @return string|null Watermarks path prefix. |
||
191 | */ |
||
192 | public function getWatermarksPathPrefix() |
||
198 | |||
199 | /** |
||
200 | * Get image manipulation API. |
||
201 | * @return Api Image manipulation API. |
||
202 | */ |
||
203 | public function getApi() |
||
210 | |||
211 | /** |
||
212 | * Get Intervention image manager. |
||
213 | * @return ImageManager Intervention image manager. |
||
214 | */ |
||
215 | public function getImageManager() |
||
227 | |||
228 | /** |
||
229 | * Get image manipulators. |
||
230 | * @return array Image manipulators. |
||
231 | */ |
||
232 | public function getManipulators() |
||
252 | |||
253 | /** |
||
254 | * Get maximum image size. |
||
255 | * @return int|null Maximum image size. |
||
256 | */ |
||
257 | public function getMaxImageSize() |
||
263 | |||
264 | /** |
||
265 | * Get default image manipulations. |
||
266 | * @return array Default image manipulations. |
||
267 | */ |
||
268 | public function getDefaults() |
||
276 | |||
277 | /** |
||
278 | * Get preset image manipulations. |
||
279 | * @return array Preset image manipulations. |
||
280 | */ |
||
281 | public function getPresets() |
||
289 | |||
290 | /** |
||
291 | * Get base URL. |
||
292 | * @return string|null Base URL. |
||
293 | */ |
||
294 | public function getBaseUrl() |
||
300 | |||
301 | /** |
||
302 | * Get response factory. |
||
303 | * @return ResponseFactoryInterface|null Response factory. |
||
304 | */ |
||
305 | public function getResponseFactory() |
||
311 | |||
312 | /** |
||
313 | * Create configured server. |
||
314 | * @param array $config Configuration parameters. |
||
315 | * @return Server Configured server. |
||
316 | */ |
||
317 | public static function create(array $config = []) |
||
321 | } |
||
322 |