getLatest() public static méthode

Fetches the version of the latest stable release
public static getLatest ( ) : string
Résultat string
Exemple #1
0
 public function checkVersion()
 {
     if (isset($this->_options['skipVersionCheck']) && $this->_options['skipVersionCheck']) {
         return;
     }
     if (!$this->getAdmin()->isSuper()) {
         return;
     }
     // only check once per 24 hours per session
     if (isset($this->getSessionNamespace()->versionChecked) && $this->getSessionNamespace()->versionChecked > time() - 86400) {
         return;
     }
     // only check once in a 24h period for each user
     $lastCheck = $this->getAdmin()->getPreference('version_last_check_at');
     if ($lastCheck && $lastCheck > time() - 86400) {
         $this->getSessionNamespace()->versionChecked = $lastCheck;
         return;
     }
     // is there a new version available?
     $latest = ViMbAdmin_Version::getLatest();
     if ($latest != 'not available') {
         if (ViMbAdmin_Version::compareVersion($latest) == 1) {
             $this->addMessage(sprintf(_('Current version is: %s. There is a new version available: %s. ' . 'See the <a href="https://github.com/opensolutions/ViMbAdmin/releases/tag/' . $latest . '">releases list</a>.'), ViMbAdmin_Version::VERSION, ViMbAdmin_Version::getLatest()), OSS_Message::INFO);
         }
     }
     $this->getSessionNamespace()->versionChecked = time();
     $this->getAdmin()->setPreference('version_last_check_at', $this->getSessionNamespace()->versionChecked);
     $this->getD2EM()->flush();
 }
Exemple #2
0
 public function checkVersion()
 {
     // only check once per 24 hours per session
     if (isset($this->_session->versionChecked) && $this->_session->versionChecked > time() - 86400) {
         return;
     }
     // only check once in a 24h period for each user
     $lastCheck = ConfigTable::getValue('version_last_check_at.' . $this->getAdmin()->id);
     if ($lastCheck && $lastCheck > time() - 86400) {
         $this->_session->versionChecked = $lastCheck;
         return;
     }
     // is there a new version available?
     if (ViMbAdmin_Version::compareVersion(ViMbAdmin_Version::getLatest()) == 1) {
         $this->addMessage(sprintf(_('Current version is: %s. There is a new version available: %s. See the <a href="https://github.com/opensolutions/ViMbAdmin/blob/master/CHANGELOG">change log</a>.'), ViMbAdmin_Version::VERSION, ViMbAdmin_Version::getLatest()), ViMbAdmin_Message::INFO);
     }
     $this->_session->versionChecked = time();
     ConfigTable::setValue('version_last_check_at.' . $this->getAdmin()->id, $this->_session->versionChecked);
 }