| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com) 7 * @license LGPL http://www.gnu.org/copyleft/lesser.html 8 */ 9 10 require_once('limb/wact/src/annotation/WactClassAnnotationParser.class.php'); 11 12 /** 13 * abstract class WactCompilerArtifactDictionary. 14 * 15 * @package wact 16 * @version $Id: WactCompilerArtifactDictionary.class.php 5945 2007-06-06 08:31:43Z pachanga $ 17 */ 18 abstract class WactCompilerArtifactDictionary 19 { 20 protected $search_paths = array(); 21 protected $config; 22 23 function __construct($config = null) { 24 $this->config = $config; 25 } 26 27 abstract function _createArtifactsExtractor($file); 28 29 function setConfig($config) 30 { 31 $this->config = $config; 32 } 33 34 function _prepareSearchPaths() 35 { 36 $paths = array(); 37 38 $include_path_array = explode(PATH_SEPARATOR, get_include_path()); 39 $include_path_array[] = ''; 40 41 foreach($include_path_array as $include_path_dir) 42 { 43 if ($include_path_dir) 44 $include_path_dir .= '/'; 45 46 foreach($this->config->getScanDirectories() as $dir) 47 { 48 foreach($this->_getThisAndImmediateDirectories($include_path_dir . $dir) as $item) 49 $paths[] = $item; 50 } 51 } 52 $this->search_paths = $paths; 53 } 54 55 function _getThisAndImmediateDirectories($dir) 56 { 57 $dirs = array(); 58 foreach(glob("$dir/*") as $item) { 59 if($item{0} != '.' && is_dir($item)) 60 $dirs[] = $item; 61 } 62 63 $dirs[] = $dir; 64 65 return $dirs; 66 } 67 68 function extractItems($scandir, $extension) 69 { 70 $parser = new WactClassAnnotationParser(); 71 72 foreach(glob("$scandir/*$extension") as $file) 73 { 74 $extractor = $this->_createArtifactsExtractor($file); 75 $parser->process($extractor, file_get_contents($file)); 76 } 77 } 78 79 function buildDictionary($extension) 80 { 81 $this->_prepareSearchPaths(); 82 83 foreach ($this->search_paths as $path) 84 $this->extractItems($path, $extension); 85 } 86 } 87 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Dec 2 03:54:09 2008 | Cross-referenced by PHPXref 0.7 |