-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathupdate.php
29 lines (22 loc) · 1.08 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once __DIR__ . "/inc/init.php";
if (($err = Config::init(CONF_FILE)) || ($err = Language::init(Config::get('default_language'))) || ($err = Language::t(Config::check_config()))) {
Log::write_log(Language::t($err), 0);
exit;
}
ini_set('memory_limit', Config::get('memory_limit'));
if (Config::get('self_update') > 0) {
if (Tools::ping(SELFUPDATE_SERVER, SELFUPDATE_PORT) === true) {
SelfUpdate::init();
if (SelfUpdate::is_need_to_update()) {
Log::informer(Language::t("New version is available on server [%s]!", SelfUpdate::get_version_on_server()), null, 0);
if (Config::get('self_update') > 1) {
SelfUpdate::start_to_update();
Log::informer(Language::t("Your script has been successfully updated to version %s!", SelfUpdate::get_version_on_server()), null, 0);
}
} else
Log::write_log(Language::t("You already have actual version of script! No need to update!"), 0);
} else
Log::write_log(Language::t("Update server is down!"), 0);
}
$nod32ms = new Nod32ms();