1 | <?php |
||
13 | class ResponsiveFactory { |
||
14 | |||
15 | /** |
||
16 | * The image driver to use. |
||
17 | * Available drivers: 'gd' and 'imagick'. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $driver; |
||
22 | |||
23 | /** |
||
24 | * The source path to load images from. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $sourcePath; |
||
29 | |||
30 | /** |
||
31 | * The public path to save rendered images. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $publicPath; |
||
36 | |||
37 | /** |
||
38 | * The minimum file size of generated images. |
||
39 | * No image with a size less then this amount (in KB), will be generated. |
||
40 | * |
||
41 | * @var integer |
||
42 | */ |
||
43 | protected $minSize; |
||
44 | |||
45 | /** |
||
46 | * Enabled cache will stop generated images from being overwritten. |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $enableCache; |
||
51 | |||
52 | /** |
||
53 | * A percentage (between 0 and 1) to decrease image sizes with. |
||
54 | * |
||
55 | * @var float |
||
56 | */ |
||
57 | protected $stepModifier; |
||
58 | |||
59 | /** |
||
60 | * The Intervention image engine. |
||
61 | * |
||
62 | * @var ImageManager |
||
63 | */ |
||
64 | protected $engine; |
||
65 | |||
66 | /** |
||
67 | * @var Filesystem |
||
68 | */ |
||
69 | protected $fs; |
||
70 | |||
71 | /** |
||
72 | * ResponsiveFactory constructor. |
||
73 | * |
||
74 | * @param ResponsiveFactoryConfigurator $configurator |
||
75 | */ |
||
76 | public function __construct(ResponsiveFactoryConfigurator $configurator) { |
||
89 | |||
90 | /** |
||
91 | * @param string $src |
||
92 | * |
||
93 | * @return ResponsiveImage |
||
94 | * @throws FileNotFoundException |
||
95 | */ |
||
96 | public function create($src) { |
||
151 | |||
152 | /** |
||
153 | * @param $directory |
||
154 | * @param string $path |
||
155 | * |
||
156 | * @return SplFileInfo |
||
157 | */ |
||
158 | private function getImageFile($directory, $path) { |
||
164 | |||
165 | /** |
||
166 | * @param string $driver |
||
167 | * |
||
168 | * @return ResponsiveFactory |
||
169 | */ |
||
170 | public function setDriver($driver) { |
||
175 | |||
176 | /** |
||
177 | * @param string $publicPath |
||
178 | * |
||
179 | * @return ResponsiveFactory |
||
180 | */ |
||
181 | public function setPublicPath($publicPath) { |
||
186 | |||
187 | /** |
||
188 | * @param boolean $enableCache |
||
189 | * |
||
190 | * @return ResponsiveFactory |
||
191 | */ |
||
192 | public function setEnableCache($enableCache) { |
||
197 | |||
198 | /** |
||
199 | * @param int $minSize |
||
200 | * |
||
201 | * @return ResponsiveFactory |
||
202 | */ |
||
203 | public function setMinSize($minSize) { |
||
208 | |||
209 | /** |
||
210 | * @param float $stepModifier |
||
211 | * |
||
212 | * @return ResponsiveFactory |
||
213 | */ |
||
214 | public function setStepModifier($stepModifier) { |
||
219 | |||
220 | /** |
||
221 | * @param string $sourcePath |
||
222 | * |
||
223 | * @return ResponsiveFactory |
||
224 | */ |
||
225 | public function setSourcePath($sourcePath) { |
||
230 | |||
231 | } |
||
232 |