Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53710 - in website/public_html/beta: common/code doc
From: daniel_james_at_[hidden]
Date: 2009-06-07 06:32:34


Author: danieljames
Date: 2009-06-07 06:32:33 EDT (Sun, 07 Jun 2009)
New Revision: 53710
URL: http://svn.boost.org/trac/boost/changeset/53710

Log:
Add a hook for pre-processing the extracted file from the zipfile.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 5 +++++
   website/public_html/beta/doc/display_build.php | 15 ++++++++++++++-
   2 files changed, 19 insertions(+), 1 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 2009-06-07 06:32:33 EDT (Sun, 07 Jun 2009)
@@ -14,6 +14,7 @@
     var $archive_ = NULL;
     var $extractor_ = NULL;
     var $type_ = NULL;
+ var $preprocess_ = NULL;
     var $title_ = NULL;
     var $charset_ = NULL;
     var $content_ = NULL;
@@ -62,6 +63,7 @@
             {
                 $this->extractor_ = $i[2];
                 $this->type_ = $i[3];
+ $this->preprocess_ = isset($i[4]) ? $i[4] : NULL;
                 break;
             }
         }
@@ -88,6 +90,9 @@
             $this->content_ = $this->_extract_string($unzip);
             $f = '_init_'.$this->extractor_;
             $this->$f();
+ if($this->preprocess_) {
+ $this->content_ = call_user_func($this->preprocess_, $this->content_);
+ }
             if ($this->extractor_ == 'simple')
             {
                 $f = '_content_'.$this->extractor_;

Modified: website/public_html/beta/doc/display_build.php
==============================================================================
--- website/public_html/beta/doc/display_build.php (original)
+++ website/public_html/beta/doc/display_build.php 2009-06-07 06:32:33 EDT (Sun, 07 Jun 2009)
@@ -1,9 +1,22 @@
 <?php
 require_once(dirname(__FILE__) . '/../common/code/boost_archive.php');
 
+function add_boost_build_analytics($content) {
+ $analytics = <<<EOS
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+</script>
+<script type="text/javascript">
+_uacct = "UA-2917240-2";
+urchinTracker();
+</script>
+EOS;
+
+ return stripos($content, '_uacct = "UA-2917240-2"') !== FALSE ? $content :
+ str_ireplace('</body>', $analytics.'</body>', $content);
+}
 $_file = new boost_archive('@^[/]([^/]+)[/](.*)$@',$_SERVER["PATH_INFO"],array(
   //~ array(version-regex,path-regex,raw|simple|text|cpp|boost_book_html|boost_libs_html,mime-type),
- array('@.*@','@^boost-build/index[.]html$@i','simple','text/html'),
+ array('@.*@','@^boost-build/index[.]html$@i','simple','text/html', 'add_boost_build_analytics'),
   array('@.*@','@[.](html|htm)$@i','boost_book_html','text/html')
   ),false,false);
 


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