Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2008-03-27 21:05:28


Author: grafik
Date: 2008-03-27 21:05:27 EDT (Thu, 27 Mar 2008)
New Revision: 43899
URL: http://svn.boost.org/trac/boost/changeset/43899

Log:
Add handling for downloading specific archives directly from the archives dir. For example to download the nightly Boost Build snapshots.
Added:
   website/public_html/beta/common/code/boost_download.php (contents, props changed)
Text files modified:
   website/public_html/beta/.htaccess | 2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)

Modified: website/public_html/beta/.htaccess
==============================================================================
--- website/public_html/beta/.htaccess (original)
+++ website/public_html/beta/.htaccess 2008-03-27 21:05:27 EDT (Thu, 27 Mar 2008)
@@ -17,6 +17,8 @@
 
 RewriteRule ^boost-build2$ boost-build2/index.html [R]
 RewriteRule ^boost-build2/$ boost-build2/index.html [R]
+RewriteRule ^boost-build2/(boost-build[.]tar[.]bz2)$ common/code/boost_download.php/$1 [L]
+RewriteRule ^boost-build2/(boost-build[.]zip)$ common/code/boost_download.php/$1 [L]
 RewriteRule ^boost-build2/(.*) doc/display_build.php/boost-build/boost-build/$1 [L]
 
 ########## Rewrite rules to support the regression test links from the old site.

Added: website/public_html/beta/common/code/boost_download.php
==============================================================================
--- (empty file)
+++ website/public_html/beta/common/code/boost_download.php 2008-03-27 21:05:27 EDT (Thu, 27 Mar 2008)
@@ -0,0 +1,23 @@
+<?php
+/*
+ Copyright 2008 Redshift Software, Inc.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+*/
+require_once(dirname(__FILE__) . '/boost.php');
+
+switch ($_SERVER["PATH_INFO"])
+{
+ case '/boost-build.tar.bz2': $fname = 'boost-build.tar.bz2'; $ftype = 'application/x-bzip'; break;
+ case '/boost-build.zip': $fname = 'boost-build.zip'; $ftype = 'application/zip'; break;
+}
+if (isset($fname))
+{
+ header('Content-Type: '.$ftype);
+ header("Content-Length: " . filesize(ARCHIVE_DIR.'/'.$fname));
+ header('Content-Disposition: attachment; filename="'.$fname.'"');
+ $file_handle = fopen(ARCHIVE_DIR.'/'.$fname,'rb');
+ fpassthru($file_handle);
+ fclose($file_handle);
+}
+?>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk