Exemplo n.º 1
0
 public static function getUpdates($version, $build)
 {
     $db = Database::obtain();
     // erhöhe die Version Statistik für den Build
     Updates::updateVersionStats($build);
     $sql = "SELECT * FROM `" . TABLE_VERSIONS . "` WHERE `build`>'" . $build . "' ORDER BY `build` DESC";
     $version_array = array();
     $version_array['changes'] = array();
     $rows = $db->fetch_array($sql);
     if (empty($rows)) {
         $message = array();
         $message['message'] = "no updates";
         return (object) $message;
     } else {
         $version_array['version'] = $rows[0]['version'];
         $version_array['build'] = $rows[0]['build'];
         $version_array['update'] = "http://gctour.madd.in/download/gctour.user.js";
         foreach ($rows as $record) {
             $version = array();
             $version['version'] = $record['version'];
             $version['build'] = $record['build'];
             $version['changes'] = preg_split("/(\r?\n)/", $record['bugfixes']);
             $version_array['changes'][] = (object) $version;
         }
         return (object) $version_array;
     }
 }