1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-23 13:58:25 +01:00

Refresh UpdateHook

This commit is contained in:
Thomas Zilio 2019-07-24 11:13:48 +02:00
parent 102d5214ef
commit b1631ae128
3 changed files with 11 additions and 9 deletions

View File

@ -2,20 +2,16 @@
include_once __DIR__.'/../../core.php';
use Modules\Aggiornamenti\UpdateHook;
$id = post('id');
switch (filter('op')) {
case 'check':
$api = json_decode(get_remote_data('https://api.github.com/repos/devcode-it/openstamanager/releases'), true);
$result = UpdateHook::isAvailable();
UpdateHook::update($result);
$version = ltrim($api[0]['tag_name'], 'v');
$current = Update::getVersion();
if (version_compare($current, $version) < 0) {
echo $version;
} else {
echo 'none';
}
echo $result;
break;

View File

@ -182,6 +182,10 @@ class Update
// Normalizzazione di charset e collation
self::normalizeDatabase($database->getDatabaseName());
if (class_exists('\Modules\Aggiornamenti\UpdateHook')) {
\Modules\Aggiornamenti\UpdateHook::update(null);
}
return true;
}

View File

@ -39,6 +39,7 @@ return [
'co_statidocumento',
'co_statipreventivi',
'co_tipidocumento',
'co_tipi_scadenze',
'dt_aspettobeni',
'dt_causalet',
'dt_ddt',
@ -104,6 +105,7 @@ return [
'zz_smtps',
'zz_tokens',
'zz_users',
'zz_user_sedi',
'zz_views',
'zz_widgets',
];