Changeset 3
- Timestamp:
- 08/25/06 20:33:18 (2 years ago)
- Files:
-
- trunk/XJConf/ext/xinc/XInclude.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/XJConf/ext/xinc/XInclude.php
r2 r3 6 6 /** 7 7 * Very basic xInclude mechanism 8 * 8 * 9 9 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 10 10 */ … … 17 17 /** 18 18 * Namespace of the extension 19 * 19 * 20 20 * @var string 21 21 */ … … 23 23 24 24 /** 25 * Get the namspace URI 26 * 25 * Get the namspace URI 26 * 27 27 * @return string 28 28 */ … … 34 34 /** 35 35 * Handle an opening tag. 36 * 36 * 37 37 * Currently this does not do anything. 38 * 38 * 39 39 * Future versions should check, whether the file exists and skip all 40 40 * child elements. 41 * 41 * 42 42 * @param XmlParser $parser 43 43 * @param Tag $tag … … 50 50 /** 51 51 * Handle a closing tag. 52 * 52 * 53 53 * Does the actual x-include. 54 * 54 * 55 55 * @param XmlParser $parser 56 56 * @param Tag $tag … … 64 64 throw new UnknownTagException('Unknown tag <' + $tag->getName() . '> in XInclude namespace.'); 65 65 } 66 66 67 67 $href = $tag->getAttribute('href'); 68 68 if (null == $href) { 69 69 return null; 70 70 } 71 71 72 72 if (substr($href, 0, 1) != '/') { 73 73 $href = dirname($reader->getCurrentFile()) . '/' . $href; 74 74 } 75 75 76 76 try { 77 reader.parse($href);77 $reader->parse($href); 78 78 return null; 79 79 } catch (Exception $e) { 80 throw new XIncludeException('Could not xInclude ' . href . ': ' . $e->getMessage());81 } 80 throw new XIncludeException('Could not xInclude ' . $href . ': ' . $e->getMessage()); 81 } 82 82 } 83 83 }
