1 | <?php |
||
13 | class ResponsiveFactory |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * The image driver to use. |
||
18 | * Available drivers: 'gd' and 'imagick'. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $driver; |
||
23 | |||
24 | /** |
||
25 | * The source path to load images from. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $sourcePath; |
||
30 | |||
31 | /** |
||
32 | * The public path to save rendered images. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $publicPath; |
||
37 | |||
38 | /** |
||
39 | * Enabled cache will stop generated images from being overwritten. |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | private $enableCache; |
||
44 | |||
45 | /** |
||
46 | * The Intervention image engine. |
||
47 | * |
||
48 | * @var ImageManager |
||
49 | */ |
||
50 | protected $engine; |
||
51 | |||
52 | /** |
||
53 | * @var Filesystem |
||
54 | */ |
||
55 | protected $fs; |
||
56 | |||
57 | /** |
||
58 | * @var Scaler |
||
59 | */ |
||
60 | protected $scaler; |
||
61 | |||
62 | /** |
||
63 | * ResponsiveFactory constructor. |
||
64 | * |
||
65 | * @param ResponsiveFactoryConfigurator $configurator |
||
66 | */ |
||
67 | public function __construct(ResponsiveFactoryConfigurator $configurator) { |
||
80 | |||
81 | /** |
||
82 | * @param string $src |
||
83 | * |
||
84 | * @return ResponsiveImage |
||
85 | * @throws FileNotFoundException |
||
86 | */ |
||
87 | public function create($src) { |
||
125 | |||
126 | /** |
||
127 | * @param string $directory |
||
128 | * @param string $path |
||
129 | * |
||
130 | * @return SplFileInfo |
||
131 | */ |
||
132 | private function getImageFile($directory, $path) { |
||
138 | |||
139 | /** |
||
140 | * @param string $driver |
||
141 | * |
||
142 | * @return ResponsiveFactory |
||
143 | */ |
||
144 | public function setDriver($driver) { |
||
149 | |||
150 | /** |
||
151 | * @param string $publicPath |
||
152 | * |
||
153 | * @return ResponsiveFactory |
||
154 | */ |
||
155 | public function setPublicPath($publicPath) { |
||
160 | |||
161 | /** |
||
162 | * @param boolean $enableCache |
||
163 | * |
||
164 | * @return ResponsiveFactory |
||
165 | */ |
||
166 | public function setEnableCache($enableCache) { |
||
171 | |||
172 | /** |
||
173 | * @param string $sourcePath |
||
174 | * |
||
175 | * @return ResponsiveFactory |
||
176 | */ |
||
177 | public function setSourcePath($sourcePath) { |
||
182 | |||
183 | /** |
||
184 | * @param Scaler $scaler |
||
185 | */ |
||
186 | public function setScaler($scaler) { |
||
189 | |||
190 | } |
||
191 |