[tools 2/3] winegecko: Update url generation to include correct folder.
Octavian Voicu
octavian.voicu at gmail.com
Thu Aug 26 18:40:42 CDT 2010
---
winegecko.php | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/winegecko.php b/winegecko.php
index 986a235..abd4370 100644
--- a/winegecko.php
+++ b/winegecko.php
@@ -12,16 +12,26 @@
* 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'];
+ $sFileSuffix = $sVersion;
if(isset($_GET['arch']))
- $sVersion = $sVersion.'-'.$_GET['arch'];
+ $sFileSuffix = $sFileSuffix.'-'.$_GET['arch'];
}
// Name of the file
-$sFileName = "wine_gecko".($sVersion?'-'.$sVersion:'').".cab";
+$sFileName = sprintf('%s/%s/wine_gecko%s.cab', $sFolder, $sVersion, $sFileSuffix?'-'.$sFileSuffix:$sFileSuffix);
// Size array
$aFileSizes = array(
@@ -36,7 +46,7 @@ $aFileSizes = array(
);
// Exact size of the file:
-$iFileSize = $aFileSizes[$sVersion ? $sVersion : 'default'];
+$iFileSize = $aFileSizes[$sFileSuffix ? $sFileSuffix : 'default'];
if(!$iFileSize) {
header("HTTP/1.0 404 Not Found");
exit;
--
1.7.0.4
More information about the wine-patches
mailing list