| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Smarty read include path plugin | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage PluginsInternal | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |  * @author Monte Ohrt | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Smarty Internal Read Include Path Class | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage PluginsInternal | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | class Smarty_Internal_Get_Include_Path { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Return full file path from PHP include_path | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |      * @param string $filepath filepath | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @return string|boolean full filepath or false | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |      */ | 
					
						
							|  |  |  |     public static function getIncludePath($filepath) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         static $_include_path = null; | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($_path_array === null) { | 
					
						
							|  |  |  |             $_include_path = explode(PATH_SEPARATOR, get_include_path()); | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         foreach ($_include_path as $_path) { | 
					
						
							|  |  |  |             if (file_exists($_path . DS . $filepath)) { | 
					
						
							|  |  |  |                 return $_path . DS . $filepath; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |          | 
					
						
							|  |  |  |         return false; | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2010-12-13 22:05:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ?>
 |