Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83867 - in website/public_html/beta: . common/code doc
From: dnljms_at_[hidden]
Date: 2013-04-13 09:48:07


Author: danieljames
Date: 2013-04-13 09:48:06 EDT (Sat, 13 Apr 2013)
New Revision: 83867
URL: http://svn.boost.org/trac/boost/changeset/83867

Log:
Add `boost-min-version` and `boost-max-version` tags to library xml. Refs #2848.

Allows a library to expire, or for different information to be displayed for
different versions.

Text files modified:
   website/public_html/beta/common/code/boost_libraries.php | 11 ++++++++++-
   website/public_html/beta/doc/libraries.php | 6 +++++-
   website/public_html/beta/sitemap.xml.php | 6 +++++-
   3 files changed, 20 insertions(+), 3 deletions(-)

Modified: website/public_html/beta/common/code/boost_libraries.php
==============================================================================
--- website/public_html/beta/common/code/boost_libraries.php (original)
+++ website/public_html/beta/common/code/boost_libraries.php 2013-04-13 09:48:06 EDT (Sat, 13 Apr 2013)
@@ -61,6 +61,8 @@
                     }
                     break;
                     case 'boost-version':
+ case 'boost-min-version':
+ case 'boost-max-version':
                     {
                         if (isset($val['value'])) { $lib[$val['tag']] = BoostVersion::from($val['value']); }
                         else { $lib[$val['tag']] = ''; }
@@ -93,7 +95,12 @@
             }
             else if ($val['tag'] == 'library' && $val['type'] == 'close' && $lib)
             {
- $this->db[$lib['key']] = $lib;
+ $key_base = $key = $lib['key'];
+ $count = 0;
+ while (isset($this->db[$key])) {
+ $key = $key_base.(++$count);
+ }
+ $this->db[$key] = $lib;
                 $lib = NULL;
             }
         }
@@ -101,6 +108,8 @@
     
     function get($sort = null, $filter = null) {
         $libs = $filter ? array_filter($this->db, $filter) : $this->db;
+ // Strip out the array keys, as they shouldn't be used externally.
+ $libs = array_values($libs);
         if($sort) {
             uasort($libs, sort_by_field($sort));
         }

Modified: website/public_html/beta/doc/libraries.php
==============================================================================
--- website/public_html/beta/doc/libraries.php (original)
+++ website/public_html/beta/doc/libraries.php 2013-04-13 09:48:06 EDT (Sat, 13 Apr 2013)
@@ -98,6 +98,10 @@
   global $filter_value, $category_value;
 
   return BoostVersion::page()->compare($lib['boost-version']) >= 0 &&
+ (!isset($lib['boost-min-version']) ||
+ BoostVersion::page()->compare($lib['boost-min-version']) >= 0) &&
+ (!isset($lib['boost-max-version']) ||
+ BoostVersion::page()->compare($lib['boost-max-version']) <= 0) &&
       (!$filter_value || ($lib[$filter_value] && $lib[$filter_value] !== 'false')) &&
       (!isset($_GET['filter']) || $lib[$_GET['filter']]) &&
       (!$category_value || $category_value === 'all' ||
@@ -249,7 +253,7 @@
 
               <dl>
                 <?php
- foreach ($libs->get($sort_value, 'library_filter') as $key => $lib) { ?>
+ foreach ($libs->get($sort_value, 'library_filter') as $lib) { ?>
 
                 <dt><?php libref($lib); ?></dt>
 

Modified: website/public_html/beta/sitemap.xml.php
==============================================================================
--- website/public_html/beta/sitemap.xml.php (original)
+++ website/public_html/beta/sitemap.xml.php 2013-04-13 09:48:06 EDT (Sat, 13 Apr 2013)
@@ -12,7 +12,11 @@
 // Returns true if the library is part of the current release of boost.
 
 function current_version_filter($lib) {
- return BoostVersion::current()->compare($lib['boost-version']) >= 0;
+ return BoostVersion::current()->compare($lib['boost-version']) >= 0 &&
+ (!isset($lib['boost-min-version']) ||
+ BoostVersion::current()->compare($lib['boost-min-version']) >= 0);
+ (!isset($lib['boost-max-version']) ||
+ BoostVersion::current()->compare($lib['boost-max-version']) <= 0);
 }
 
 function xmlentities($text) {


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