|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83865 - in website/public_html/beta: common/code doc generated
From: dnljms_at_[hidden]
Date: 2013-04-13 08:55:09
Author: danieljames
Date: 2013-04-13 08:55:08 EDT (Sat, 13 Apr 2013)
New Revision: 83865
URL: http://svn.boost.org/trac/boost/changeset/83865
Log:
Also make `$categories` private.
Note that php arrays are COW so this protects the member variable from
modification.
Text files modified:
website/public_html/beta/common/code/boost_libraries.php | 6 +++++-
website/public_html/beta/doc/libraries.php | 9 +++++----
2 files changed, 10 insertions(+), 5 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 08:55:08 EDT (Sat, 13 Apr 2013)
@@ -10,7 +10,7 @@
class boost_libraries
{
- var $categories = array();
+ private $categories = array();
private $db = array();
function boost_libraries($xml_file)
@@ -124,5 +124,9 @@
return $categories;
}
+
+ function get_categories() {
+ return $this->categories;
+ }
}
?>
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 08:55:08 EDT (Sat, 13 Apr 2013)
@@ -24,6 +24,7 @@
$libs = USE_SERIALIZED_INFO ?
unserialize(file_get_contents(dirname(__FILE__) . '/../generated/libraries.txt')) :
new boost_libraries(dirname(__FILE__) . '/libraries.xml');
+$categories = $libs->get_categories();
// Display types:
@@ -66,7 +67,7 @@
}
else if(strpos($view_value, 'category_') === 0) {
$category_value = substr($view_value, strlen('category_'));
- if(!isset($libs->categories[$category_value])) {
+ if(!isset($categories[$category_value])) {
echo 'Invalid category: '.htmlentities($category_value); exit(0);
}
}
@@ -89,7 +90,7 @@
// Page title
$page_title = boost_title().' Library Documentation';
-if($category_value) $page_title.= ' - '. $libs->categories[$category_value]['title'];
+if($category_value) $page_title.= ' - '. $categories[$category_value]['title'];
// Functions
@@ -244,7 +245,7 @@
<?php if($view_value != 'categorized') { ?>
- <?php if($category_value) echo '<h2>', htmlentities($libs->categories[$category_value]['title']), '</h2>'; ?>
+ <?php if($category_value) echo '<h2>', htmlentities($categories[$category_value]['title']), '</h2>'; ?>
<dl>
<?php
@@ -271,7 +272,7 @@
<dt>Categories</dt>
- <dd><?php libcategories($lib, $libs->categories); ?></dd>
+ <dd><?php libcategories($lib, $categories); ?></dd>
</dl>
</dd><!-- --><?php } ?>
</dl>
Modified: website/public_html/beta/generated/libraries.txt
==============================================================================
Binary files website/public_html/beta/generated/libraries.txt (original) and website/public_html/beta/generated/libraries.txt 2013-04-13 08:55:08 EDT (Sat, 13 Apr 2013) differ
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