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) { |
||
146 | |||
147 | /** |
||
148 | * @param $directory |
||
149 | * @param string $path |
||
150 | * |
||
151 | * @return SplFileInfo |
||
152 | */ |
||
153 | private function getImageFile($directory, $path) { |
||
159 | |||
160 | /** |
||
161 | * @param string $driver |
||
162 | * |
||
163 | * @return ResponsiveFactory |
||
164 | */ |
||
165 | public function setDriver($driver) { |
||
170 | |||
171 | /** |
||
172 | * @param string $publicPath |
||
173 | * |
||
174 | * @return ResponsiveFactory |
||
175 | */ |
||
176 | public function setPublicPath($publicPath) { |
||
181 | |||
182 | /** |
||
183 | * @param boolean $enableCache |
||
184 | * |
||
185 | * @return ResponsiveFactory |
||
186 | */ |
||
187 | public function setEnableCache($enableCache) { |
||
192 | |||
193 | /** |
||
194 | * @param int $minSize |
||
195 | * |
||
196 | * @return ResponsiveFactory |
||
197 | */ |
||
198 | public function setMinSize($minSize) { |
||
203 | |||
204 | /** |
||
205 | * @param float $stepModifier |
||
206 | * |
||
207 | * @return ResponsiveFactory |
||
208 | */ |
||
209 | public function setStepModifier($stepModifier) { |
||
214 | |||
215 | /** |
||
216 | * @param string $sourcePath |
||
217 | * |
||
218 | * @return ResponsiveFactory |
||
219 | */ |
||
220 | public function setSourcePath($sourcePath) { |
||
225 | |||
226 | } |
||
227 |