Exemplo n.º 1
0
 public function checkupAction()
 {
     $v = $this->_getParam('v');
     $os = $this->_getParam('os');
     if (!$v || !$os) {
         $out['errno'] = '255';
         $out['msg'] = Yy_ErrMsg_More::getMsg('checkup', $out['errno']);
         Yy_Utils::jsonOut($out);
         return;
     }
     $packagemgt = Application_Model_M_PackageMgt::fetchByPlatform($os);
     if ($packagemgt) {
         $lastv = $packagemgt->getVersion();
         if ($lastv > $v) {
             $out['errno'] = '0';
             $out['desc'] = $packagemgt->getDescription();
             $out['url'] = $packagemgt->getUrl();
         } else {
             $out['errno'] = '1';
         }
     } else {
         $out['errno'] = '1';
     }
     $out['msg'] = Yy_ErrMsg_More::getMsg('checkup', $out['errno']);
     Yy_Utils::jsonOut($out);
 }