Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64917 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2010-08-19 04:19:58


Author: danieljames
Date: 2010-08-19 04:19:55 EDT (Thu, 19 Aug 2010)
New Revision: 64917
URL: http://svn.boost.org/trac/boost/changeset/64917

Log:
Simpler load file code.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 41 ++++++---------------------------------
   1 files changed, 7 insertions(+), 34 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2010-08-19 04:19:55 EDT (Thu, 19 Aug 2010)
@@ -121,6 +121,9 @@
             return;
         }
 
+ header('Expires: '.date(DATE_RFC2822, strtotime("+1 month")));
+ header('Cache-Control: max-age=2592000'); // 30 days
+
         // Note: this sets $params['content'] with either the content or an error
         // message:
         if(!extract_file($unzip, $params['content'])) {
@@ -135,12 +138,10 @@
             return;
         }
 
- // Note: this sets $params['content'] with either the content or an error
- // message:
- if(!extract_unzipped_file($params['file'], $params['content'])) {
- file_not_found($params, $params['content']);
- return;
- }
+ header('Expires: '.date(DATE_RFC2822, strtotime("+1 month")));
+ header('Cache-Control: max-age=2592000'); // 30 days
+
+ $params['content'] = file_get_contents($params['file']);
     }
     
     if($type == 'text/html') {
@@ -299,34 +300,6 @@
     }
 }
 
-function extract_unzipped_file($file, &$content) {
- header('Expires: '.date(DATE_RFC2822, strtotime("+1 month")));
- header('Cache-Control: max-age=2592000'); // 30 days
-
- $file_handle = fopen($file,'r');
-
- if($file_handle === FALSE) {
- $content = null;
- return false;
- }
-
- $text = '';
- while ($file_handle && !feof($file_handle)) {
- $text .= fread($file_handle,8*1024);
- }
- $exit_status = fclose($file_handle);
-
- if($exit_status) {
- $content = $text;
- return true;
- }
- else {
- $content = null;
- return false;
- }
-}
-
-
 //
 // Filters
 //


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