Changeset 1616 for trunk/buildscripts

Show
Ignore:
Timestamp:
01/13/2007 04:39:48 PM (23 months ago)
Author:
xue
Message:

updated build script.

Location:
trunk/buildscripts
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/buildscripts/classtree/build.php

    r1598 r1616  
    1818        '/I18N/core', 
    1919        '/3rdParty', 
    20         '/Web/Security' 
     20        '/Web/Security', 
     21        '/Configuration', 
     22        '/Web/Services/TFeedService.php', 
     23        '/Web/Services/IFeedContentProvider.php' 
    2124        ); 
    2225$a=new ClassTreeBuilder($frameworkPath,$exclusions); 
  • trunk/buildscripts/index/build.php

    r1055 r1616  
    1010 
    1111//quickstart source and the index data target directories. 
    12 $quickstart_source = realpath(dirname(__FILE__).'/../texbuilder/pages.php'); 
     12$quickstart_source = realpath(dirname(__FILE__).'/../texbuilder/quickstart/pages.php'); 
    1313$quickstart_base = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/pages/'); 
    1414$quickstart_target = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index/quickstart/'); 
     
    4747                foreach($hits as $hit) 
    4848                        echo "   ".$hit->title."\n"; 
    49                          
     49 
    5050                $a = new Zend_Search_Lucene($api_target); 
    5151                $query = $argv[1]; 
  • trunk/buildscripts/index/quickstart_index.php

    r1055 r1616  
    55        private $_index; 
    66        private $_dir; 
    7          
     7 
    88        private $_base; 
    99        private $_source; 
    10          
     10 
    1111        public function __construct($index_file, $base, $source) 
    1212        { 
     
    1616                $this->_source = $source; 
    1717        } 
    18          
     18 
    1919        public function create_index() 
    2020        { 
     
    3131                                $this->add($file_content,$section, filemtime($page)); 
    3232                                $count++; 
    33                         }                
     33                        } 
    3434                } 
    35                  
     35 
    3636                $this->_index->commit(); 
    37                 echo "\n {$count} files indexed.\n";             
     37                echo "\n {$count} files indexed.\n"; 
    3838        } 
    39          
     39 
    4040        public function add($content, $section, $mtime) 
    4141        { 
     
    4545                        $link = "index.php?page=".preg_replace('/\/|\\\/', '.', $section); 
    4646                        $link = str_replace('.page', '', $link).'#'.$headers['section']; 
    47                          
     47 
    4848                        //unsearchable text 
    4949                        $doc->addField(Zend_Search_Lucene_Field::UnIndexed('link', $link)); 
    5050                        $doc->addField(Zend_Search_Lucene_Field::UnIndexed('mtime', $mtime)); 
    5151                        $doc->addField(Zend_Search_Lucene_Field::UnIndexed('title', $headers['title'])); 
    52                         $doc->addField(Zend_Search_Lucene_Field::UnIndexed('text', $headers['content']));                
    53                          
     52                        $doc->addField(Zend_Search_Lucene_Field::UnIndexed('text', $headers['content'])); 
     53 
    5454                        //searchable text 
    5555                        $doc->addField(Zend_Search_Lucene_Field::Keyword('page', strtolower($headers['title']))); 
     
    5757                        $doc->addField(Zend_Search_Lucene_Field::Unstored('contents',$body)); 
    5858                        $this->_index->addDocument($doc); 
    59                 }                
     59                } 
    6060        } 
    61          
    62         function sanitize($input)  
     61 
     62        function sanitize($input) 
    6363        { 
    6464                return htmlentities(strip_tags( $input )); 
    65         }        
    66          
     65        } 
     66 
    6767        public function index() 
    6868        { 
    6969                return $this->_index; 
    7070        } 
    71          
     71 
    7272        protected function split_headings($html) 
    7373        { 
    7474                $html = preg_replace('/<\/?com:TContent[^<]*>/', '', $html); 
    75                  
     75 
    7676                $html = preg_replace('/<b>([^<]*)<\/b>/', '$1', $html); 
    7777                $html = preg_replace('/<i>([^<]*)<\/i>/', '$1', $html); 
    7878                $html = preg_replace('/<tt>([^<]*)<\/tt>/', '$1', $html); 
    79                  
     79 
    8080                $html = preg_replace('/<h1([^>]*)>([^<]*)<\/h1>/', '<hh$1>$2</hh>', $html); 
    8181                $html = preg_replace('/<h2([^>]*)>([^<]*)<\/h2>/', '<hh$1>$2</hh>', $html); 
    8282                $html = preg_replace('/<h3([^>]*)>([^<]*)<\/h3>/', '<hh$1>$2</hh>', $html); 
    83                  
    84                  
     83 
     84 
    8585                $sections = preg_split('/<hh[^>]*>([^<]+)<\/hh>/', $html,-1); 
    8686                $headers = array(); 
     
    9090                { 
    9191                        $content['title'] = trim($this->sanitize($headers[2][$i-1])); 
    92                         $sec = array(); 
    93                         preg_match('/"([^"]*)"/', $headers[1][$i-1], $sec); 
    94                         $content['section'] = str_replace('"', '',$sec[0]); 
     92                        $content['section'] = str_replace('"', '',trim($headers[1][$i-1],'"')); 
    9593                        $content['content'] = trim($this->sanitize($sections[$i])); 
    9694                        $contents[] = $content; 
     
    9997                return $contents; 
    10098        } 
    101          
     99 
    102100        public function commit() 
    103101        { 
    104                 $this->_index->commit();                 
     102                $this->_index->commit(); 
    105103                $count = $this->_index->count(); 
    106104                echo "\nSaving search index ({$count}) to {$this->_dir}\n\n"; 
  • trunk/buildscripts/phing/tasks/QuickstartIndexTask.php

    r1186 r1616  
    55/** 
    66 * Task to index quickstart 
    7  */      
     7 */ 
    88class QuickstartIndexTask extends Task 
    99{ 
     
    2121                set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path)); 
    2222                require_once ('Zend/Search/Lucene.php'); 
    23                  
     23 
    2424                require_once($srcdir.'/buildscripts/index/quickstart_index.php'); 
    25                 $quickstart_source = $srcdir.'/buildscripts/texbuilder/pages.php'; 
     25                $quickstart_source = $srcdir.'/buildscripts/texbuilder/quickstart/pages.php'; 
    2626                $quickstart_base = $srcdir.'/demos/quickstart/protected/pages/'; 
    2727                $quickstart = new quickstart_index($this->todir, realpath($quickstart_base), realpath($quickstart_source));