コード例 #1
0
ファイル: update.class.php プロジェクト: GaelGRIFFON/core
 public function checkUpdate()
 {
     if ($this->getType() == 'core') {
         $update_info = jeedom::needUpdate(true);
         $this->setLocalVersion($update_info['version']);
         $this->setRemoteVersion($update_info['currentVersion']);
         if ($update_info['needUpdate']) {
             $this->setStatus('update');
         } else {
             $this->setStatus('ok');
         }
         $this->save();
     } else {
         try {
             $market_info = market::getInfo(array('logicalId' => $this->getLogicalId(), 'type' => $this->getType()), $this->getConfiguration('version', 'stable'));
             $this->setStatus($market_info['status']);
             $this->setConfiguration('market_owner', $market_info['market_owner']);
             $this->setConfiguration('market', $market_info['market']);
             $this->setRemoteVersion($market_info['datetime']);
             $this->save();
         } catch (Exception $ex) {
         }
     }
 }