Octavian Voicu : winegecko: Update url generation to include correct folder .
Alexandre Julliard
julliard at winehq.org
Fri Aug 27 11:05:25 CDT 2010
Module: tools
Branch: master
Commit: c31cc0c78b0298bb6be07b1cc239f0d4ba3f65f6
URL: http://source.winehq.org/git/tools.git/?a=commit;h=c31cc0c78b0298bb6be07b1cc239f0d4ba3f65f6
Author: Octavian Voicu <octavian.voicu at gmail.com>
Date: Fri Aug 27 02:40:42 2010 +0300
winegecko: Update url generation to include correct folder.
---
winegecko.php | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/winegecko.php b/winegecko.php
index 986a235..4440279 100644
--- a/winegecko.php
+++ b/winegecko.php
@@ -12,20 +12,28 @@
* Copyright (c) 2006 Jonathan Ernst
*/
+// Default version if none given
+$sVersion = '0.0.1';
+
+// Suffix appended to base name of file
+$sFileSuffix = '';
+
+// Folder which contains wine gecko files
+$sFolder = 'Wine%20Gecko';
+
// Check if a specific version was passed
if(isset($_GET['v'])) {
$sVersion = $_GET['v'];
if(isset($_GET['arch']))
- $sVersion = $sVersion.'-'.$_GET['arch'];
+ $sFileSuffix = $sVersion.'-'.$_GET['arch'];
}
// Name of the file
-$sFileName = "wine_gecko".($sVersion?'-'.$sVersion:'').".cab";
+$sFileName = sprintf('%s/%s/wine_gecko-%s.cab', $sFolder, $sVersion, $sFileSuffix ? $sFileSuffix : $sVersion);
// Size array
$aFileSizes = array(
- 'default'=>5219822,
'0.0.1'=>5219822,
'0.1.0'=>5746895,
'0.9.0'=>7806669,
@@ -36,7 +44,7 @@ $aFileSizes = array(
);
// Exact size of the file:
-$iFileSize = $aFileSizes[$sVersion ? $sVersion : 'default'];
+$iFileSize = $aFileSizes[$sFileSuffix ? $sFileSuffix : $sVersion];
if(!$iFileSize) {
header("HTTP/1.0 404 Not Found");
exit;
More information about the wine-cvs
mailing list