Revision 925
Added by doc almost 16 years ago
install.php | ||
---|---|---|
29 | 29 |
exit(0); |
30 | 30 |
} |
31 | 31 |
|
32 |
// do not display notices and warnings during installation |
|
33 |
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); |
|
34 |
|
|
32 | 35 |
// Setup admin object |
33 | 36 |
require('../../config.php'); |
34 | 37 |
require_once(WB_PATH.'/framework/class.admin.php'); |
... | ... | |
57 | 60 |
$archive = new PclZip($temp_file); |
58 | 61 |
// Unzip the files to the temp unzip folder |
59 | 62 |
$list = $archive->extract(PCLZIP_OPT_PATH, $temp_unzip); |
63 |
|
|
64 |
// Check if uploaded file is a valid Add-On zip file |
|
65 |
if (!($list && file_exists($temp_unzip . 'index.php'))) $admin->print_error($MESSAGE['GENERIC']['INVALID_ADDON_FILE']); |
|
66 |
|
|
60 | 67 |
// Include the modules info file |
61 | 68 |
require($temp_unzip.'info.php'); |
69 |
|
|
70 |
// Perform Add-on requirement checks before proceeding |
|
71 |
require(WB_PATH . '/framework/addon.precheck.inc.php'); |
|
72 |
preCheckAddon($temp_file); |
|
73 |
|
|
62 | 74 |
// Delete the temp unzip directory |
63 | 75 |
rm_full_dir($temp_unzip); |
64 | 76 |
|
... | ... | |
76 | 88 |
if(file_exists(WB_PATH.'/modules/'.$module_directory.'/info.php')) { |
77 | 89 |
require(WB_PATH.'/modules/'.$module_directory.'/info.php'); |
78 | 90 |
// Version to be installed is older than currently installed version |
79 |
if ($module_version>=$new_module_version) {
|
|
91 |
if (versionCompare($module_version, $new_module_version, '>=')) {
|
|
80 | 92 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file |
81 | 93 |
$admin->print_error($MESSAGE['GENERIC']['ALREADY_INSTALLED']); |
82 | 94 |
} |
Also available in: Unified diff
Added option to perform pre-installation checks to test requirements of Add-Ons