Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61982 - in website/public_html/beta: common/code doc
From: daniel_james_at_[hidden]
Date: 2010-05-15 06:47:12


Author: danieljames
Date: 2010-05-15 06:47:11 EDT (Sat, 15 May 2010)
New Revision: 61982
URL: http://svn.boost.org/trac/boost/changeset/61982

Log:
When displaying documentation check if this is a future version.

This is a bit of a hack, need better handling of versions.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 3 ++-
   website/public_html/beta/common/code/boost_version.php | 31 ++++++++++++++++++++++++++++++-
   website/public_html/beta/doc/display_libs.php | 13 ++++++++++++-
   website/public_html/beta/doc/libraries.php | 3 ++-
   4 files changed, 46 insertions(+), 4 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-05-15 06:47:11 EDT (Sat, 15 May 2010)
@@ -69,7 +69,7 @@
         $this->key_ = $archive_location_details['key'];
         $this->file_ = $archive_location_details['file'];
         $this->archive_ = $archive_location_details['archive'];
-
+
         $info_map = array_merge($content_map, array(
             array('@.*@','@[.](txt|py|rst|jam|v2|bat|sh|xml|qbk)$@i','text','text/plain'),
             array('@.*@','@[.](c|h|cpp|hpp)$@i','cpp','text/plain'),
@@ -96,6 +96,7 @@
         }
         
         if ($extractor) $this->extractor_ = $extractor;
+
         if (!$this->extractor_) {
             file_not_found($this->file_);
             return;

Modified: website/public_html/beta/common/code/boost_version.php
==============================================================================
--- website/public_html/beta/common/code/boost_version.php (original)
+++ website/public_html/beta/common/code/boost_version.php 2010-05-15 06:47:11 EDT (Sat, 15 May 2010)
@@ -6,6 +6,8 @@
 */
 require_once(dirname(__FILE__) . '/boost.php');
 
+$boost_current_version = Array(1,43,0);
+
 function boost_title()
 {
     $vinfo = array();
@@ -44,4 +46,31 @@
         return TRUE;
     }
 }
-?>
+
+function boost_future_version($version)
+{
+ if ($version)
+ {
+ $vinfo = array();
+ preg_match('@([0-9]+)_([0-9]+)_([0-9]+)@',$version,$vinfo);
+ if (isset($vinfo[0]))
+ {
+ global $boost_current_version;
+ $v = $boost_current_version[0];
+ $r = $boost_current_version[1];
+ $p = $boost_current_version[2];
+ return
+ ($v < $vinfo[1]) ||
+ ($v == $vinfo[1] && $r < $vinfo[2]) ||
+ ($v == $vinfo[1] && $r == $vinfo[2] && $p < $vinfo[3]);
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ return FALSE;
+ }
+}

Modified: website/public_html/beta/doc/display_libs.php
==============================================================================
--- website/public_html/beta/doc/display_libs.php (original)
+++ website/public_html/beta/doc/display_libs.php 2010-05-15 06:47:11 EDT (Sat, 15 May 2010)
@@ -1,5 +1,6 @@
 <?php
 require_once(dirname(__FILE__) . '/../common/code/boost_archive.php');
+require_once(dirname(__FILE__) . '/../common/code/boost_version.php');
 
 function add_spirit_analytics($content) {
     if(stripos($content, '_uacct = "UA-11715441-2"') !== FALSE)
@@ -32,8 +33,18 @@
     return str_ireplace('</head>', $analytics.'</head>', $content);
 }
 
+$location = get_archive_location('@^[/]([^/]+)[/](.*)$@',$_SERVER["PATH_INFO"]);
+
+if (boost_future_version($location['version'])) {
+ file_not_found($location['file'],
+ "Documentation for this version has not been uploaded yet. ".
+ "Documentation is only uploaded when it's fully released, ".
+ "you can see the documentation for a beta version or snapshot in the download.");
+ return;
+}
+
 display_from_archive(
- get_archive_location('@^[/]([^/]+)[/](.*)$@',$_SERVER["PATH_INFO"]),
+ $location,
   array(
   //~ array(version-regex,path-regex,raw|simple|text|cpp|boost_book_html|boost_libs_html,mime-type[,preprocess hook]),
   //~ this handles most of the simple cases of index.htm(l) redirect files

Modified: website/public_html/beta/doc/libraries.php
==============================================================================
--- website/public_html/beta/doc/libraries.php (original)
+++ website/public_html/beta/doc/libraries.php 2010-05-15 06:47:11 EDT (Sat, 15 May 2010)
@@ -96,7 +96,8 @@
     }
     else
     {
- $docref = '/doc/libs/1_43_0/'.$lib['documentation'];
+ global $boost_current_version;
+ $docref = '/doc/libs/'.implode('_', $boost_current_version).'/'.$lib['documentation'];
     }
     print ''.($lib['name'] ? $lib['name'] : $lib['key']).'';
   }


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