Changeset 413 for trunk/patTemplate/Reader
- Timestamp:
- 08/05/05 15:51:01 (3 years ago)
- Files:
-
- trunk/patTemplate/Reader/DB.php (modified) (3 diffs)
- trunk/patTemplate/Reader/File.php (modified) (1 diff)
- trunk/patTemplate/Reader/IT.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/patTemplate/Reader/DB.php
r412 r413 49 49 50 50 /** 51 * read templates from any input 51 * read templates from the database 52 * 53 * Input may either be an SQL query or a string defining the location 54 * of the template using the format: 55 * <code> 56 * table[@key=value]/@templateField 57 * </code> 52 58 * 53 59 * @final … … 67 73 68 74 /** 75 * fetch the template data from the database 69 76 * 70 * 71 * 77 * @access protected 78 * @param string input to read from 72 79 */ 73 80 function getDataFromDb($input) … … 82 89 83 90 // establish connection 84 $db = &DB::connect($this-> _options['root']);91 $db = &DB::connect($this->getTemplateRoot()); 85 92 if (PEAR::isError($db)) { 86 93 return patErrorManager::raiseError(PATTEMPLATE_READER_DB_ERROR_NO_CONNECTION, 'Could not establish database connection: ' . $db->getMessage()); trunk/patTemplate/Reader/File.php
r394 r413 117 117 return $filename; 118 118 } else { 119 120 if (!is_array($ this->_options['root'])) {121 $ this->_options['root'] = array($this->_options['root']);119 $rootFolders = $this->getTemplateRoot(); 120 if (!is_array($rootFolders)) { 121 $rootFolders = array($rootFolders); 122 122 } 123 foreach ($ this->_options['root']as $root) {123 foreach ($rootFolders as $root) { 124 124 if ($relativeTo === false) { 125 125 $baseDir = $root; trunk/patTemplate/Reader/IT.php
r232 r413 193 193 function _resolveFullPath( $filename ) 194 194 { 195 $baseDir = $this->_options['root'];196 $fullPath =$baseDir . '/' . $filename;195 $baseDir = $this->getTemplateRoot(); 196 $fullPath = $baseDir . '/' . $filename; 197 197 return $fullPath; 198 198 } … … 207 207 function _getFileContents( $file ) 208 208 { 209 210 209 if( !file_exists( $file ) || !is_readable( $file ) ) 211 210 {
