Re: [TOOLS] Re: Gecko installer

2006-06-30 Thread Jacek Caban

Jeremy Newman wrote:

This is now live at:
http://source.winehq.org/winegecko.php

On Sun, 2006-06-25 at 11:40 +0200, Jonathan Ernst wrote:
  

Le samedi 24 juin 2006 à 20:06 +0200, Jacek Caban a écrit :


Hi,

  

[...]

- We need php script redirecting to SourceForge similar to one that 
forwards to Mozilla ActiveX control.
  

Here you are.



Thanks Jeremy and Jonathan. I'll send patches that will add the last 
missing part.


Jacek




Re: [TOOLS] Re: Gecko installer

2006-06-29 Thread Boaz Harrosh

Jeremy Newman wrote:

This is now live at:
http://source.winehq.org/winegecko.php

  

This is grate!
 It is Based on SeaMonkey version 1.8.0.1. We might want to do some 
kind of version system, this thing gets updated pretty fast, security 
updates and stuff...


By the way, How do you make a CAB file is there a free tool to make it? 
or is it Just a renamed ZIP file?


Free Life
Boaz





Re: [TOOLS] Re: Gecko installer

2006-06-28 Thread Jeremy Newman
This is now live at:
http://source.winehq.org/winegecko.php

On Sun, 2006-06-25 at 11:40 +0200, Jonathan Ernst wrote:
 Le samedi 24 juin 2006 à 20:06 +0200, Jacek Caban a écrit :
  Hi,
  
 [...]
  - We need php script redirecting to SourceForge similar to one that 
  forwards to Mozilla ActiveX control.
 
 Here you are.
 
 





[TOOLS] Re: Gecko installer

2006-06-25 Thread Jonathan Ernst
Le samedi 24 juin 2006 à 20:06 +0200, Jacek Caban a écrit :
 Hi,
 
[...]
 - We need php script redirecting to SourceForge similar to one that 
 forwards to Mozilla ActiveX control.

Here you are.


--- /dev/null	2006-01-19 01:09:08.0 +0100
+++ winegecko.php	2006-06-25 11:37:20.0 +0200
@@ -0,0 +1,90 @@
+?php
+/**
+ * Redirects to one of many URLs that have the Wine Gecko installer available.
+ * 
+ * Usage: 
+ * winegecko.php
+ * (main usage, redirects to one of many URLs that have the Wine Gecko installer available)
+ * 
+ * winegecko.php?action=showlist
+ * (display a list of server and tells if the file is available for each server)
+ * 
+ * Copyright (c) 2006 Jonathan Ernst
+ */
+
+
+// Name of the file
+$sFileName = wine_gecko.cab;
+
+// Exact size of the file:
+$iFileSize = 5219822;
+
+// List of locations
+$aList = array(http://switch.dl.sourceforge.net/sourceforge/wine/;,
+   http://surfnet.dl.sourceforge.net/sourceforge/wine/;,
+   http://citkit.dl.sourceforge.net/sourceforge/wine/;,
+   http://keihanna.dl.sourceforge.net/sourceforge/wine/;,
+   http://heanet.dl.sourceforge.net/sourceforge/wine/;,
+   http://easynews.dl.sourceforge.net/sourceforge/wine/;,
+   http://ovh.dl.sourceforge.net/sourceforge/wine/;,
+   http://jaist.dl.sourceforge.net/sourceforge/wine/;,
+   http://puzzle.dl.sourceforge.net/sourceforge/wine/;,
+   http://nchc.dl.sourceforge.net/sourceforge/wine/;,
+   http://switch.dl.sourceforge.net/sourceforge/wine/;,
+   http://kent.dl.sourceforge.net/sourceforge/wine/;,
+   http://optusnet.dl.sourceforge.net/sourceforge/wine/;,
+   http://mesh.dl.sourceforge.net/sourceforge/wine/;,
+   http://internap.dl.sourceforge.net/sourceforge/wine/;,
+   http://superb-east.dl.sourceforge.net/sourceforge/wine/;,
+   http://optusnet.dl.sourceforge.net/sourceforge/wine/;,
+   http://superb-west.dl.sourceforge.net/sourceforge/wine/;,
+   http://nchc.dl.sourceforge.net/sourceforge/wine/;,
+   http://umn.dl.sourceforge.net/sourceforge/wine/;,
+   http://belnet.dl.sourceforge.net/sourceforge/wine/;,
+   http://ufpr.dl.sourceforge.net/sourceforge/wine/;
+   );
+
+   
+function is_downloadable($sUrl){
+global $iFileSize;
+$parse = parse_url($sUrl);
+// open a socket connection
+if($fp = @fsockopen($parse['host'], 80, $errno, $errstr, 10)){
+// set request
+$get = HEAD .$parse['path']. HTTP/1.1\r\n.
+   Host: .$parse['host'].\r\n.
+   Connection: close\r\n\r\n;
+fputs($fp, $get);
+while(!feof($fp)){
+// get ONLY header informations
+$header .= fgets($fp, 128);
+}
+fclose($fp);
+// match file size
+preg_match('/Content-Length:\s([0-9].+?)\s/', $header, $matches);
+$iSize = intval($matches[1]);
+if($iSize == $iFileSize) return TRUE;
+}
+return FALSE;
+}
+
+
+if($_REQUEST['action']==showlist) {
+echo h2List of mirrors available for file .$sFileName. (.$iFileSize. bytes)/h2;
+foreach($aList as $sLocation) {
+echo $sLocation.: ;
+if(is_downloadable($sLocation.$sFileName)) {
+echo font color=\green\online/font;
+} else {
+echo font color=\red\offline/font;
+}
+echo \nbr /;
+}
+} else {
+while(!is_downloadable($sUrl)) {
+$iRand = rand(0, (sizeof($aList)-1));
+$sUrl = $aList[$iRand].$sFileName;
+}
+header(Location: .$sUrl);
+}
+?


signature.asc
Description: Ceci est une partie de message	numériquement signée