| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * Project:     Smarty: the PHP compiling template engine | 
					
						
							|  |  |  |  * File:        smarty_internal_utility.php | 
					
						
							|  |  |  |  * SVN:         $Id: $ | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  * License as published by the Free Software Foundation; either | 
					
						
							|  |  |  |  * version 2.1 of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  * Lesser General Public License for more details. | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  * License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * For questions, help, comments, discussion, etc., please join the | 
					
						
							|  |  |  |  * Smarty mailing list. Send a blank e-mail to | 
					
						
							|  |  |  |  * smarty-discussion-subscribe@googlegroups.com | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * @link http://www.smarty.net/ | 
					
						
							|  |  |  |  * @copyright 2008 New Digital Group, Inc. | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |  * @author Monte Ohrt <monte at ohrt dot com> | 
					
						
							|  |  |  |  * @author Uwe Tews | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage PluginsInternal | 
					
						
							|  |  |  |  * @version 3-SVN$Rev: 3286 $ | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Utility class | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package Smarty | 
					
						
							|  |  |  |  * @subpackage Security | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  | class Smarty_Internal_Utility { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * private constructor to prevent calls creation of new instances | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     private final function __construct() | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // intentionally left blank
 | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |      * Compile all template files | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string $extension     template file name extension | 
					
						
							|  |  |  |      * @param bool   $force_compile force all to recompile | 
					
						
							|  |  |  |      * @param int    $time_limit    set maximum execution time | 
					
						
							|  |  |  |      * @param int    $max_errors    set maximum allowed errors | 
					
						
							|  |  |  |      * @param Smarty $smarty        Smarty instance | 
					
						
							|  |  |  |      * @return integer number of template files compiled | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public static function compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty) | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         // switch off time limit
 | 
					
						
							|  |  |  |         if (function_exists('set_time_limit')) { | 
					
						
							|  |  |  |             @set_time_limit($time_limit); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $smarty->force_compile = $force_compile; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         $_count = 0; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         $_error_count = 0; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         // loop over array of template directories
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         foreach($smarty->getTemplateDir() as $_dir) { | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |             $_compileDirs = new RecursiveDirectoryIterator($_dir); | 
					
						
							|  |  |  |             $_compile = new RecursiveIteratorIterator($_compileDirs); | 
					
						
							|  |  |  |             foreach ($_compile as $_fileinfo) { | 
					
						
							|  |  |  |                 $_file = $_fileinfo->getFilename(); | 
					
						
							| 
									
										
										
										
											2012-11-27 13:37:35 +00:00
										 |  |  |                 if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue; | 
					
						
							|  |  |  |                 if ($_fileinfo->getPath() == substr($_dir, 0, -1)) { | 
					
						
							| 
									
										
										
										
											2010-09-17 18:10:10 +00:00
										 |  |  |                    $_template_file = $_file; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 } else { | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |                    $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file; | 
					
						
							| 
									
										
										
										
											2010-09-17 18:10:10 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 echo '<br>', $_dir, '---', $_template_file; | 
					
						
							|  |  |  |                 flush(); | 
					
						
							| 
									
										
										
										
											2010-06-24 14:43:04 +00:00
										 |  |  |                 $_start_time = microtime(true); | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 try { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     $_tpl = $smarty->createTemplate($_template_file,null,null,null,false); | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |                     if ($_tpl->mustCompile()) { | 
					
						
							|  |  |  |                         $_tpl->compileTemplateSource(); | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  |                         $_count++; | 
					
						
							| 
									
										
										
										
											2010-06-24 14:43:04 +00:00
										 |  |  |                         echo ' compiled in  ', microtime(true) - $_start_time, ' seconds'; | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |                         flush(); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         echo ' is up to date'; | 
					
						
							|  |  |  |                         flush(); | 
					
						
							| 
									
										
										
										
											2011-01-14 18:39:16 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 catch (Exception $e) { | 
					
						
							|  |  |  |                     echo 'Error: ', $e->getMessage(), "<br><br>"; | 
					
						
							|  |  |  |                     $_error_count++; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 // free memory
 | 
					
						
							|  |  |  |                 $smarty->template_objects = array(); | 
					
						
							| 
									
										
										
										
											2011-01-14 21:51:08 +00:00
										 |  |  |                 $_tpl->smarty->template_objects = array(); | 
					
						
							|  |  |  |                 $_tpl = null; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                 if ($max_errors !== null && $_error_count == $max_errors) { | 
					
						
							|  |  |  |                     echo '<br><br>too many errors'; | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                     exit(); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |         return $_count; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Compile all config files | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string $extension     config file name extension | 
					
						
							|  |  |  |      * @param bool   $force_compile force all to recompile | 
					
						
							|  |  |  |      * @param int    $time_limit    set maximum execution time | 
					
						
							|  |  |  |      * @param int    $max_errors    set maximum allowed errors | 
					
						
							|  |  |  |      * @param Smarty $smarty        Smarty instance | 
					
						
							|  |  |  |      * @return integer number of config files compiled | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public static function compileAllConfig($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty) | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2010-03-29 15:41:01 +00:00
										 |  |  |         // switch off time limit
 | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |         if (function_exists('set_time_limit')) { | 
					
						
							|  |  |  |             @set_time_limit($time_limit); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $smarty->force_compile = $force_compile; | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |         $_count = 0; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         $_error_count = 0; | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |         // loop over array of template directories
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         foreach($smarty->getConfigDir() as $_dir) { | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |             $_compileDirs = new RecursiveDirectoryIterator($_dir); | 
					
						
							|  |  |  |             $_compile = new RecursiveIteratorIterator($_compileDirs); | 
					
						
							|  |  |  |             foreach ($_compile as $_fileinfo) { | 
					
						
							|  |  |  |                 $_file = $_fileinfo->getFilename(); | 
					
						
							| 
									
										
										
										
											2012-11-27 13:37:35 +00:00
										 |  |  |                 if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue; | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                 if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue; | 
					
						
							|  |  |  |                 if ($_fileinfo->getPath() == substr($_dir, 0, -1)) { | 
					
						
							|  |  |  |                     $_config_file = $_file; | 
					
						
							|  |  |  |                 } else { | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |                     $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                 echo '<br>', $_dir, '---', $_config_file; | 
					
						
							|  |  |  |                 flush(); | 
					
						
							| 
									
										
										
										
											2010-06-24 14:43:04 +00:00
										 |  |  |                 $_start_time = microtime(true); | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                 try { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                     $_config = new Smarty_Internal_Config($_config_file, $smarty); | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                     if ($_config->mustCompile()) { | 
					
						
							|  |  |  |                         $_config->compileConfigSource(); | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  |                         $_count++; | 
					
						
							| 
									
										
										
										
											2010-06-24 14:43:04 +00:00
										 |  |  |                         echo ' compiled in  ', microtime(true) - $_start_time, ' seconds'; | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                         flush(); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         echo ' is up to date'; | 
					
						
							|  |  |  |                         flush(); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                 catch (Exception $e) { | 
					
						
							|  |  |  |                     echo 'Error: ', $e->getMessage(), "<br><br>"; | 
					
						
							|  |  |  |                     $_error_count++; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-03-25 21:18:58 +00:00
										 |  |  |                 if ($max_errors !== null && $_error_count == $max_errors) { | 
					
						
							|  |  |  |                     echo '<br><br>too many errors'; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                     exit(); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         return $_count; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |      * Delete compiled template file | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param string  $resource_name template name | 
					
						
							|  |  |  |      * @param string  $compile_id    compile id | 
					
						
							|  |  |  |      * @param integer $exp_time      expiration time | 
					
						
							|  |  |  |      * @param Smarty  $smarty        Smarty instance | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |      * @return integer number of template files deleted | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty) | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $_compile_dir = $smarty->getCompileDir(); | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  |         $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $_dir_sep = $smarty->use_sub_dirs ? DS : '^'; | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         if (isset($resource_name)) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $_save_stat = $smarty->caching; | 
					
						
							|  |  |  |             $smarty->caching = false; | 
					
						
							|  |  |  |             $tpl = new $smarty->template_class($resource_name, $smarty); | 
					
						
							|  |  |  |             $smarty->caching = $_save_stat; | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-13 13:10:06 +00:00
										 |  |  |             // remove from template cache
 | 
					
						
							|  |  |  |             $tpl->source; // have the template registered before unset()
 | 
					
						
							| 
									
										
										
										
											2011-10-21 18:40:16 +00:00
										 |  |  |             if ($smarty->allow_ambiguous_resources) { | 
					
						
							|  |  |  |                 $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-21 12:10:41 +00:00
										 |  |  |             if (isset($_templateId[150])) { | 
					
						
							|  |  |  |                 $_templateId = sha1($_templateId); | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-13 13:10:06 +00:00
										 |  |  |             unset($smarty->template_objects[$_templateId]); | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if ($tpl->source->exists) { | 
					
						
							|  |  |  |                  $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath)); | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                  $_resource_part_1_length = strlen($_resource_part_1); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             } else { | 
					
						
							|  |  |  |                 return 0; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1); | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |             $_resource_part_2_length = strlen($_resource_part_2); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $_dir = $_compile_dir; | 
					
						
							|  |  |  |         if ($smarty->use_sub_dirs && isset($_compile_id)) { | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |             $_dir .= $_compile_id . $_dir_sep; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         if (isset($_compile_id)) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep; | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |             $_compile_id_part_length = strlen($_compile_id_part); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         $_count = 0; | 
					
						
							| 
									
										
										
										
											2011-10-20 12:50:12 +00:00
										 |  |  |         try { | 
					
						
							|  |  |  |             $_compileDirs = new RecursiveDirectoryIterator($_dir); | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  |         // NOTE: UnexpectedValueException thrown for PHP >= 5.3
 | 
					
						
							|  |  |  |         } catch (Exception $e) { | 
					
						
							| 
									
										
										
										
											2011-10-20 12:50:12 +00:00
										 |  |  |             return 0; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); | 
					
						
							|  |  |  |         foreach ($_compile as $_file) { | 
					
						
							| 
									
										
										
										
											2012-08-14 13:22:34 +00:00
										 |  |  |             if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false) | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |                 continue; | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |             $_filepath = (string) $_file; | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |             if ($_file->isDir()) { | 
					
						
							|  |  |  |                 if (!$_compile->isDot()) { | 
					
						
							|  |  |  |                     // delete folder if empty
 | 
					
						
							|  |  |  |                     @rmdir($_file->getPathname()); | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |             } else { | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                 $unlink = false; | 
					
						
							|  |  |  |                 if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  |                     && (!isset($resource_name) | 
					
						
							|  |  |  |                         || (isset($_filepath[$_resource_part_1_length]) | 
					
						
							|  |  |  |                             && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0) | 
					
						
							|  |  |  |                         || (isset($_filepath[$_resource_part_2_length]) | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                             && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) { | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                     if (isset($exp_time)) { | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                         if (time() - @filemtime($_filepath) >= $exp_time) { | 
					
						
							|  |  |  |                             $unlink = true; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                         } | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |                     } else { | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                         $unlink = true; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-01 19:11:28 +00:00
										 |  |  |                 if ($unlink && @unlink($_filepath)) { | 
					
						
							|  |  |  |                     $_count++; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2011-09-17 16:29:10 +00:00
										 |  |  |         // clear compiled cache
 | 
					
						
							|  |  |  |         Smarty_Resource::$sources = array(); | 
					
						
							|  |  |  |         Smarty_Resource::$compileds = array(); | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |         return $_count; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Return array of tag/attributes of all tags used by an template | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |      * @param Smarty_Internal_Template $templae template object | 
					
						
							| 
									
										
										
										
											2010-11-11 21:34:36 +00:00
										 |  |  |      * @return array of tag/attributes | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     public static function getTags(Smarty_Internal_Template $template) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $template->smarty->get_used_tags = true; | 
					
						
							|  |  |  |         $template->compileTemplateSource(); | 
					
						
							|  |  |  |         return $template->used_tags; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * diagnose Smarty setup | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * If $errors is secified, the diagnostic report will be appended to the array, rather than being output. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param Smarty $smarty  Smarty instance to test | 
					
						
							|  |  |  |      * @param array  $errors array to push results into rather than outputting them | 
					
						
							|  |  |  |      * @return bool status, true if everything is fine, false else | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public static function testInstall(Smarty $smarty, &$errors=null) | 
					
						
							| 
									
										
										
										
											2010-02-07 03:03:48 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         $status = true; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "<PRE>\n"; | 
					
						
							|  |  |  |             echo "Smarty Installation test...\n"; | 
					
						
							|  |  |  |             echo "Testing template directory...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |         $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // test if all registered template_dir are accessible
 | 
					
						
							|  |  |  |         foreach($smarty->getTemplateDir() as $template_dir) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |             $_template_dir = $template_dir; | 
					
						
							|  |  |  |             $template_dir = realpath($template_dir); | 
					
						
							|  |  |  |             // resolve include_path or fail existance
 | 
					
						
							|  |  |  |             if (!$template_dir) { | 
					
						
							|  |  |  |                 if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) { | 
					
						
							|  |  |  |                     // try PHP include_path
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($_stream_resolve_include_path) { | 
					
						
							|  |  |  |                         $template_dir = stream_resolve_include_path($_template_dir); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir); | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($template_dir !== false) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo "$template_dir is OK.\n"; | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         continue; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $status = false; | 
					
						
							|  |  |  |                         $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)"; | 
					
						
							|  |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo $message . ".\n"; | 
					
						
							|  |  |  |                         } else { | 
					
						
							|  |  |  |                             $errors['template_dir'] = $message; | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                         continue; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $status = false; | 
					
						
							|  |  |  |                     $message = "FAILED: $_template_dir does not exist"; | 
					
						
							|  |  |  |                     if ($errors === null) { | 
					
						
							|  |  |  |                         echo $message . ".\n"; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $errors['template_dir'] = $message; | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                     continue; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if (!is_dir($template_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $template_dir is not a directory"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['template_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif (!is_readable($template_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $template_dir is not readable"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['template_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo "$template_dir is OK.\n"; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing compile directory...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // test if registered compile_dir is accessible
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |         $__compile_dir = $smarty->getCompileDir(); | 
					
						
							|  |  |  |         $_compile_dir = realpath($__compile_dir); | 
					
						
							| 
									
										
										
										
											2011-10-16 09:53:14 +00:00
										 |  |  |         if (!$_compile_dir) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$__compile_dir} does not exist"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['compile_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_dir($_compile_dir)) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_compile_dir} is not a directory"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['compile_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_readable($_compile_dir)) { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_compile_dir} is not readable"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['compile_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_writable($_compile_dir)) { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_compile_dir} is not writable"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['compile_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo "{$_compile_dir} is OK.\n"; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing plugins directory...\n"; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // test if all registered plugins_dir are accessible
 | 
					
						
							|  |  |  |         // and if core plugins directory is still registered
 | 
					
						
							|  |  |  |         $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins'); | 
					
						
							|  |  |  |         $_core_plugins_available = false; | 
					
						
							|  |  |  |         foreach($smarty->getPluginsDir() as $plugin_dir) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |             $_plugin_dir = $plugin_dir; | 
					
						
							|  |  |  |             $plugin_dir = realpath($plugin_dir); | 
					
						
							|  |  |  |             // resolve include_path or fail existance
 | 
					
						
							|  |  |  |             if (!$plugin_dir) { | 
					
						
							|  |  |  |                 if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { | 
					
						
							|  |  |  |                     // try PHP include_path
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($_stream_resolve_include_path) { | 
					
						
							|  |  |  |                         $plugin_dir = stream_resolve_include_path($_plugin_dir); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir); | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($plugin_dir !== false) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo "$plugin_dir is OK.\n"; | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         continue; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $status = false; | 
					
						
							|  |  |  |                         $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)"; | 
					
						
							|  |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo $message . ".\n"; | 
					
						
							|  |  |  |                         } else { | 
					
						
							|  |  |  |                             $errors['plugins_dir'] = $message; | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                         continue; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $status = false; | 
					
						
							|  |  |  |                     $message = "FAILED: $_plugin_dir does not exist"; | 
					
						
							|  |  |  |                     if ($errors === null) { | 
					
						
							|  |  |  |                         echo $message . ".\n"; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $errors['plugins_dir'] = $message; | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                     continue; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if (!is_dir($plugin_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $plugin_dir is not a directory"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['plugins_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif (!is_readable($plugin_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $plugin_dir is not readable"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['plugins_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) { | 
					
						
							|  |  |  |                 $_core_plugins_available = true; | 
					
						
							| 
									
										
										
										
											2011-10-07 10:38:46 +00:00
										 |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo "$plugin_dir is OK.\n"; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             } else { | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo "$plugin_dir is OK.\n"; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (!$_core_plugins_available) { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "WARNING: Smarty's own libs/plugins is not available"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } elseif (!isset($errors['plugins_dir'])) { | 
					
						
							|  |  |  |                 $errors['plugins_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing cache directory...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         // test if all registered cache_dir is accessible
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |         $__cache_dir = $smarty->getCacheDir(); | 
					
						
							|  |  |  |         $_cache_dir = realpath($__cache_dir); | 
					
						
							| 
									
										
										
										
											2011-10-16 09:53:14 +00:00
										 |  |  |         if (!$_cache_dir) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$__cache_dir} does not exist"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['cache_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_dir($_cache_dir)) { | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_cache_dir} is not a directory"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['cache_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_readable($_cache_dir)) { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_cache_dir} is not readable"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['cache_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } elseif (!is_writable($_cache_dir)) { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: {$_cache_dir} is not writable"; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['cache_dir'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo "{$_cache_dir} is OK.\n"; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing configs directory...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // test if all registered config_dir are accessible
 | 
					
						
							|  |  |  |         foreach($smarty->getConfigDir() as $config_dir) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |             $_config_dir = $config_dir; | 
					
						
							|  |  |  |             $config_dir = realpath($config_dir); | 
					
						
							|  |  |  |             // resolve include_path or fail existance
 | 
					
						
							|  |  |  |             if (!$config_dir) { | 
					
						
							|  |  |  |                 if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) { | 
					
						
							|  |  |  |                     // try PHP include_path
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($_stream_resolve_include_path) { | 
					
						
							|  |  |  |                         $config_dir = stream_resolve_include_path($_config_dir); | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir); | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2012-03-21 17:18:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-06 20:45:10 +00:00
										 |  |  |                     if ($config_dir !== false) { | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo "$config_dir is OK.\n"; | 
					
						
							|  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                         continue; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $status = false; | 
					
						
							|  |  |  |                         $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)"; | 
					
						
							|  |  |  |                         if ($errors === null) { | 
					
						
							|  |  |  |                             echo $message . ".\n"; | 
					
						
							|  |  |  |                         } else { | 
					
						
							|  |  |  |                             $errors['config_dir'] = $message; | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                         continue; | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $status = false; | 
					
						
							|  |  |  |                     $message = "FAILED: $_config_dir does not exist"; | 
					
						
							|  |  |  |                     if ($errors === null) { | 
					
						
							|  |  |  |                         echo $message . ".\n"; | 
					
						
							|  |  |  |                     } else { | 
					
						
							|  |  |  |                         $errors['config_dir'] = $message; | 
					
						
							|  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-07 11:07:00 +00:00
										 |  |  |                     continue; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2011-10-22 16:47:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |             if (!is_dir($config_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $config_dir is not a directory"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['config_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif (!is_readable($config_dir)) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: $config_dir is not readable"; | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['config_dir'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo "$config_dir is OK.\n"; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing sysplugin files...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // test if sysplugins are available
 | 
					
						
							|  |  |  |         $source = SMARTY_SYSPLUGINS_DIR; | 
					
						
							|  |  |  |         if (is_dir($source)) { | 
					
						
							|  |  |  |             $expected = array( | 
					
						
							|  |  |  |                 "smarty_cacheresource.php" => true, | 
					
						
							|  |  |  |                 "smarty_cacheresource_custom.php" => true, | 
					
						
							|  |  |  |                 "smarty_cacheresource_keyvaluestore.php" => true, | 
					
						
							|  |  |  |                 "smarty_config_source.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_cacheresource_file.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_append.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_assign.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_block.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_break.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_call.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_capture.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_config_load.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_continue.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_debug.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_eval.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_extends.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_for.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_foreach.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_function.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_if.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_include.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_include_php.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_insert.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_ldelim.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_nocache.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_block_plugin.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_function_plugin.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_modifier.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_object_block_function.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_object_function.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_print_expression.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_registered_block.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_registered_function.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_private_special_variable.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_rdelim.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_section.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_setfilter.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compile_while.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_compilebase.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_config.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_config_file_compiler.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_configfilelexer.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_configfileparser.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_data.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_debug.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_filter_handler.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_function_call_handler.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_get_include_path.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_nocache_insert.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_parsetree.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_eval.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_extends.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_file.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_registered.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_stream.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_resource_string.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_smartytemplatecompiler.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_template.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_templatebase.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_templatecompilerbase.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_templatelexer.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_templateparser.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_utility.php" => true, | 
					
						
							|  |  |  |                 "smarty_internal_write_file.php" => true, | 
					
						
							|  |  |  |                 "smarty_resource.php" => true, | 
					
						
							|  |  |  |                 "smarty_resource_custom.php" => true, | 
					
						
							|  |  |  |                 "smarty_resource_recompiled.php" => true, | 
					
						
							|  |  |  |                 "smarty_resource_uncompiled.php" => true, | 
					
						
							|  |  |  |                 "smarty_security.php" => true, | 
					
						
							|  |  |  |             ); | 
					
						
							|  |  |  |             $iterator = new DirectoryIterator($source); | 
					
						
							|  |  |  |             foreach ($iterator as $file) { | 
					
						
							|  |  |  |                 if (!$file->isDot()) { | 
					
						
							|  |  |  |                     $filename = $file->getFilename(); | 
					
						
							|  |  |  |                     if (isset($expected[$filename])) { | 
					
						
							|  |  |  |                         unset($expected[$filename]); | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if ($expected) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected)); | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['sysplugins'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif ($errors === null) { | 
					
						
							|  |  |  |                 echo "... OK\n"; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory'; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['sysplugins_dir_constant'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Testing plugin files...\n"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         // test if core plugins are available
 | 
					
						
							|  |  |  |         $source = SMARTY_PLUGINS_DIR; | 
					
						
							|  |  |  |         if (is_dir($source)) { | 
					
						
							|  |  |  |             $expected = array( | 
					
						
							|  |  |  |                 "block.textformat.php" => true, | 
					
						
							|  |  |  |                 "function.counter.php" => true, | 
					
						
							|  |  |  |                 "function.cycle.php" => true, | 
					
						
							|  |  |  |                 "function.fetch.php" => true, | 
					
						
							|  |  |  |                 "function.html_checkboxes.php" => true, | 
					
						
							|  |  |  |                 "function.html_image.php" => true, | 
					
						
							|  |  |  |                 "function.html_options.php" => true, | 
					
						
							|  |  |  |                 "function.html_radios.php" => true, | 
					
						
							|  |  |  |                 "function.html_select_date.php" => true, | 
					
						
							|  |  |  |                 "function.html_select_time.php" => true, | 
					
						
							|  |  |  |                 "function.html_table.php" => true, | 
					
						
							|  |  |  |                 "function.mailto.php" => true, | 
					
						
							|  |  |  |                 "function.math.php" => true, | 
					
						
							|  |  |  |                 "modifier.capitalize.php" => true, | 
					
						
							|  |  |  |                 "modifier.date_format.php" => true, | 
					
						
							|  |  |  |                 "modifier.debug_print_var.php" => true, | 
					
						
							|  |  |  |                 "modifier.escape.php" => true, | 
					
						
							|  |  |  |                 "modifier.regex_replace.php" => true, | 
					
						
							|  |  |  |                 "modifier.replace.php" => true, | 
					
						
							|  |  |  |                 "modifier.spacify.php" => true, | 
					
						
							|  |  |  |                 "modifier.truncate.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.cat.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.count_characters.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.count_paragraphs.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.count_sentences.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.count_words.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.default.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.escape.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.from_charset.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.indent.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.lower.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.noprint.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.string_format.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.strip.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.strip_tags.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.to_charset.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.unescape.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.upper.php" => true, | 
					
						
							|  |  |  |                 "modifiercompiler.wordwrap.php" => true, | 
					
						
							|  |  |  |                 "outputfilter.trimwhitespace.php" => true, | 
					
						
							|  |  |  |                 "shared.escape_special_chars.php" => true, | 
					
						
							|  |  |  |                 "shared.literal_compiler_param.php" => true, | 
					
						
							|  |  |  |                 "shared.make_timestamp.php" => true, | 
					
						
							|  |  |  |                 "shared.mb_str_replace.php" => true, | 
					
						
							|  |  |  |                 "shared.mb_unicode.php" => true, | 
					
						
							|  |  |  |                 "shared.mb_wordwrap.php" => true, | 
					
						
							|  |  |  |                 "variablefilter.htmlspecialchars.php" => true, | 
					
						
							|  |  |  |             ); | 
					
						
							|  |  |  |             $iterator = new DirectoryIterator($source); | 
					
						
							|  |  |  |             foreach ($iterator as $file) { | 
					
						
							|  |  |  |                 if (!$file->isDot()) { | 
					
						
							|  |  |  |                     $filename = $file->getFilename(); | 
					
						
							|  |  |  |                     if (isset($expected[$filename])) { | 
					
						
							|  |  |  |                         unset($expected[$filename]); | 
					
						
							|  |  |  |                     } | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if ($expected) { | 
					
						
							|  |  |  |                 $status = false; | 
					
						
							|  |  |  |                 $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected)); | 
					
						
							|  |  |  |                 if ($errors === null) { | 
					
						
							|  |  |  |                     echo $message . ".\n"; | 
					
						
							|  |  |  |                 } else { | 
					
						
							|  |  |  |                     $errors['plugins'] = $message; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } elseif ($errors === null) { | 
					
						
							|  |  |  |                 echo "... OK\n"; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } else { | 
					
						
							|  |  |  |             $status = false; | 
					
						
							|  |  |  |             $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory'; | 
					
						
							|  |  |  |             if ($errors === null) { | 
					
						
							|  |  |  |                 echo $message . ".\n"; | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 $errors['plugins_dir_constant'] = $message; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         if ($errors === null) { | 
					
						
							|  |  |  |             echo "Tests complete.\n"; | 
					
						
							|  |  |  |             echo "</PRE>\n"; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2010-03-25 20:43:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  |         return $status; | 
					
						
							| 
									
										
										
										
											2011-07-26 18:09:31 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-07 11:09:28 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2011-09-16 14:19:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-17 15:39:51 +00:00
										 |  |  | ?>
 |