1 | <?php |
||
25 | class Install |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Database class instance |
||
30 | * @var \gplcart\core\Database $db |
||
31 | */ |
||
32 | protected $db; |
||
33 | |||
34 | /** |
||
35 | * Config class instance |
||
36 | * @var \gplcart\core\Config $config |
||
37 | */ |
||
38 | protected $config; |
||
39 | |||
40 | /** |
||
41 | * Module model instance |
||
42 | * @var \gplcart\core\Module $module |
||
43 | */ |
||
44 | protected $module; |
||
45 | |||
46 | /** |
||
47 | * Zip helper class instance |
||
48 | * @var \gplcart\core\helpers\Zip $zip |
||
49 | */ |
||
50 | protected $zip; |
||
51 | |||
52 | /** |
||
53 | * Url helper class instance |
||
54 | * @var \gplcart\core\helpers\Url $url |
||
55 | */ |
||
56 | protected $url; |
||
57 | |||
58 | /** |
||
59 | * Translation UI model instance |
||
60 | * @var \gplcart\core\models\Translation $translation |
||
61 | */ |
||
62 | protected $translation; |
||
63 | |||
64 | /** |
||
65 | * Job model instance |
||
66 | * @var \gplcart\core\models\Job $job |
||
67 | */ |
||
68 | protected $job; |
||
69 | |||
70 | /** |
||
71 | * Module model instance |
||
72 | * @var \gplcart\core\models\Module $module_model |
||
73 | */ |
||
74 | protected $module_model; |
||
75 | |||
76 | /** |
||
77 | * Backup model instance |
||
78 | * @var \gplcart\modules\backup\models\Backup $backup |
||
79 | */ |
||
80 | protected $backup; |
||
81 | |||
82 | /** |
||
83 | * The latest validation error |
||
84 | * @var string |
||
85 | */ |
||
86 | protected $error; |
||
87 | |||
88 | /** |
||
89 | * The temporary renamed module directory |
||
90 | * @var string |
||
91 | */ |
||
92 | protected $tempname; |
||
93 | |||
94 | /** |
||
95 | * The module directory |
||
96 | * @var string |
||
97 | */ |
||
98 | protected $destination; |
||
99 | |||
100 | /** |
||
101 | * The module ID |
||
102 | * @var string |
||
103 | */ |
||
104 | protected $module_id; |
||
105 | |||
106 | /** |
||
107 | * An array of module data |
||
108 | * @var array |
||
109 | */ |
||
110 | protected $data; |
||
111 | |||
112 | /** |
||
113 | * Whether an original module has been temporary renamed |
||
114 | * @var boolean |
||
115 | */ |
||
116 | protected $renamed; |
||
117 | |||
118 | /** |
||
119 | * @param Config $config |
||
120 | * @param Module $module |
||
121 | * @param ModuleModel $module_model |
||
122 | * @param TranslationModel $translation |
||
123 | * @param ModuleBackupModel $backup |
||
124 | * @param JobModel $job |
||
125 | * @param ZipHelper $zip |
||
126 | * @param UrlHelper $url |
||
127 | */ |
||
128 | public function __construct(Config $config, Module $module, |
||
143 | |||
144 | /** |
||
145 | * Installs a module from a ZIP file |
||
146 | * @param string $zip |
||
147 | * @return string|bool |
||
148 | */ |
||
149 | public function fromZip($zip) |
||
178 | |||
179 | /** |
||
180 | * Install modules from multiple URLs |
||
181 | * @param array $sources |
||
182 | */ |
||
183 | public function fromUrl(array $sources) |
||
200 | |||
201 | /** |
||
202 | * Returns path to error log file |
||
203 | * @return string |
||
204 | */ |
||
205 | public function getErrorLogFile() |
||
209 | |||
210 | /** |
||
211 | * Backup the previous version of the updated module |
||
212 | */ |
||
213 | protected function backup() |
||
236 | |||
237 | /** |
||
238 | * Extracts module files to the system directory |
||
239 | * @return boolean |
||
240 | */ |
||
241 | protected function extract() |
||
261 | |||
262 | /** |
||
263 | * Restore the original module files |
||
264 | */ |
||
265 | protected function rollback() |
||
275 | |||
276 | /** |
||
277 | * Validates a module data |
||
278 | * @return boolean |
||
279 | */ |
||
280 | protected function validate() |
||
298 | |||
299 | /** |
||
300 | * Returns an array of files from a ZIP file |
||
301 | * @param string $file |
||
302 | * @return array |
||
303 | */ |
||
304 | public function getFilesFromZip($file) |
||
314 | |||
315 | /** |
||
316 | * Set a module id |
||
317 | * @param string $file |
||
318 | * @return boolean |
||
319 | */ |
||
320 | protected function setModuleId($file) |
||
342 | |||
343 | /** |
||
344 | * Check if a module ID has enabled status in the database |
||
345 | * @param string $module_id |
||
346 | * @return bool |
||
347 | */ |
||
348 | protected function isEnabledModule($module_id) |
||
354 | |||
355 | /** |
||
356 | * Returns a module id from a zip file or false on error |
||
357 | * @param string $file |
||
358 | * @return boolean|string |
||
359 | */ |
||
360 | public function getModuleIdFromZip($file) |
||
387 | |||
388 | /** |
||
389 | * Whether the module files have been updated |
||
390 | * @return bool |
||
391 | */ |
||
392 | public function isUpdate() |
||
396 | |||
397 | } |
||
398 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..