diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php index 2d126c301..1b4777c01 100644 --- a/application/controllers/Debug.php +++ b/application/controllers/Debug.php @@ -27,6 +27,8 @@ class Debug extends CI_Controller $footerData = []; $footerData['scripts'] = ['assets/js/sections/debug.js']; + $this->Update_model->update_check(true); + $data['running_version'] = $this->optionslib->get_option('version'); $data['latest_release'] = $this->optionslib->get_option('latest_release'); if ($data['latest_release'] && version_compare($data['latest_release'], $data['running_version'], '>')) { diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 9de022838..420a65feb 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -428,15 +428,8 @@ class Update extends CI_Controller { } function wavelog_update_check() { - if ($this->config->item('version_check')) { - $this->load->model('Update_model'); - $running_version = $this->optionslib->get_option('version'); - $latest_release = $this->Update_model->wavelog_latest_release(); - if (version_compare($latest_release, $running_version, '>')) { - print __("Newer release available:")." ".$latest_release; - $this->Update_model->set_latest_release($latest_release); - } - } + $this->load->model('Update_model'); + $this->Update_model->update_check(); } } ?> diff --git a/application/models/Update_model.php b/application/models/Update_model.php index d07180ae5..8656dcbc8 100644 --- a/application/models/Update_model.php +++ b/application/models/Update_model.php @@ -289,4 +289,18 @@ class Update_model extends CI_Model { $this->db->insert_batch('options', $data); } } + + function update_check($silent = false) { + if ($this->config->item('version_check')) { + $this->load->model('Update_model'); + $running_version = $this->optionslib->get_option('version'); + $latest_release = $this->Update_model->wavelog_latest_release(); + if (version_compare($latest_release, $running_version, '>')) { + if (!$silent) { + print __("Newer release available:")." ".$latest_release; + } + $this->Update_model->set_latest_release($latest_release); + } + } + } }