OSDN Git Service

Small update to version checker.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 5 Jun 2014 10:19:24 +0000 (05:19 -0500)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 5 Jun 2014 10:19:24 +0000 (05:19 -0500)
vercheck/download.php
vercheck/index.php

index 5b86d15..27054dd 100644 (file)
@@ -39,10 +39,10 @@ header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
 output_reset_rewrite_vars();
 $_GET['file'] = null;
 if($_GET['file']==null) {
-$mirrors['mirror'] = array("prdownload.berlios.de","downloads.sourceforge.net","get.idb.s1.jcink.com","ihost.net46.net","idb.gamemaker2k.org","of.openfoundry.org"); 
-$mirrors['url'] = array("http://prdownload.berlios.de/idb/","http://downloads.sourceforge.net/intdb/","http://get.idb.s1.jcink.com/","http://download.ihost.net46.net/","ftp://ftp.berlios.de/pub/idb/nighty-ver/","http://of.openfoundry.org/download_path/idb/0.4.6.696/");
-$mirrors['name'] = array("BerliOS","SourceForge","Get iDB @ iDB.S1.Jcink.com","Get iDB @ IHost.Net46.net","iDB Support FTP","OpenFoundry"); 
-$mirrors['links'] = array("http://developer.berlios.de/projects/idb/","http://sourceforge.net/projects/intdb","http://get.idb.s1.jcink.com/","http://download.ihost.net46.net/","http://idb.gamemaker2k.org/","http://of.openfoundry.org/projects/1220");
+$mirrors['mirror'] = array("downloads.sourceforge.net","idb.gamemaker2k.org","of.openfoundry.org"); 
+$mirrors['url'] = array("http://downloads.sourceforge.net/intdb/","http://of.openfoundry.org/download_path/idb/0.4.6.696/");
+$mirrors['name'] = array("SourceForge","iDB Support FTP","OpenFoundry"); 
+$mirrors['links'] = array("http://sourceforge.net/projects/intdb","http://idb.gamemaker2k.org/","http://of.openfoundry.org/projects/1220");
 //$files = array("iDB.zip","iDB.tar.gz","iDB.tar.bz2","iDB.tar.lzma","iDB.tar.xz","iDB.7z","iDB.deb","iDB.rpm","iDB-Host.zip","iDB-Host.tar.gz","iDB-Host.lzma","iDB-Host.tar.xz","iDB-Host.tar.bz2","iDB-Host.7z","iDB-Host.deb","iDB-Host.rpm","iDBEH-Mod.zip","iDBEH-Mod.tar.gz","iDBEH-Mod.tar.bz2","iDBEH-Mod.tar.lzma","iDBEH-Mod.tar.xz","iDBEH-Mod.7z");
 $files = array("iDB.zip","iDB.tar.gz","iDB.tar.bz2","iDB.tar.xz","iDB.7z","iDB-Host.zip","iDB-Host.tar.gz","iDB-Host.tar.xz","iDB-Host.tar.bz2","iDB-Host.7z","iDBEH-Mod.zip","iDBEH-Mod.tar.gz","iDBEH-Mod.tar.bz2","iDBEH-Mod.tar.xz","iDBEH-Mod.7z","iDBEH-SubMod.zip","iDBEH-SubMod.tar.gz","iDBEH-SubMod.tar.bz2","iDBEH-SubMod.tar.xz","iDBEH-SubMod.7z","webinstaller.zip","webinstaller.tar.gz","webinstaller.tar.bz2","webinstaller.7z");
 ?>
index e8ffe0c..0409913 100644 (file)
@@ -414,21 +414,16 @@ if(!isset($_GET['act'])) { $_GET['act'] = null; }
 if(!isset($_GET['redirect'])) { $_GET['redirect'] = null; }
 if(isset($_GET['act'])&&$_GET['act']=="update") {
 if (function_exists("stream_context_create")) {
-    $GetNewVersion = file_get_contents("http://developer.berlios.de/project/showfiles.php?group_id=6135",false,$context);
+    $GetNewVersion = file_get_contents("http://sourceforge.jp/projects/idb/releases/",false,$context);
 } else {
-    $GetNewVersion = file_get_contents("http://developer.berlios.de/project/showfiles.php?group_id=6135");
+    $GetNewVersion = file_get_contents("http://sourceforge.jp/projects/idb/releases/");
 }
-$prepreg1 = preg_quote("<TD colspan=\"3\"><h3>iDB</h3></TD>","/"); 
-$prepreg2 = preg_quote("</A></B></TD>","/");
-preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetNewVersion, $NewVersionPart);
-$prepreg1 = preg_quote("SVN ","/"); 
-$prepreg2 = preg_quote("</A>","/");
-preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $NewVersionPart[0][0], $NewVersionPart);
-$NewSVNPart = $NewVersionPart[1][0];
+preg_match_all("/([0-9])\.([0-9])\.([0-9]) ([A-Za-z]+) SVN ([0-9]+)\<\/a\>/isU", $GetNewVersion, $NewVersionPart);
+$NewSVNPart = $NewVersionPart[5][0];
 if (function_exists("stream_context_create")) {
-    $GetSVNVersion = file_get_contents("http://intdb.svn.sourceforge.net/viewvc/intdb/trunk/inc/versioninfo.php?revision=".$NewSVNPart,false,$context);
+    $GetSVNVersion = file_get_contents("http://sourceforge.net/p/intdb/svn/".$NewSVNPart."/tree/trunk/inc/versioninfo.php?format=raw",false,$context);
 } else {
-    $GetSVNVersion = file_get_contents("http://intdb.svn.sourceforge.net/viewvc/intdb/trunk/inc/versioninfo.php?revision=".$NewSVNPart);
+    $GetSVNVersion = file_get_contents("http://sourceforge.net/p/intdb/svn/".$NewSVNPart."/tree/trunk/inc/versioninfo.php?format=raw");
 } 
 $newver['subver'] = $NewSVNPart;
 $prepreg1 = preg_quote("\$VER1[0] = ","/");