diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php')
-rw-r--r-- | vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php index 64912599f..5c046da40 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_compilealltemplates.php @@ -1,4 +1,5 @@ <?php + /** * Smarty Method CompileAllTemplates * @@ -20,22 +21,23 @@ class Smarty_Internal_Method_CompileAllTemplates /** * Compile all template files * - * @api Smarty::compileAllTemplates() + * @api Smarty::compileAllTemplates() * * @param \Smarty $smarty passed smarty object - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors * * @return integer number of template files recompiled */ - public function compileAllTemplates(Smarty $smarty, - $extension = '.tpl', - $force_compile = false, - $time_limit = 0, - $max_errors = null) - { + public function compileAllTemplates( + Smarty $smarty, + $extension = '.tpl', + $force_compile = false, + $time_limit = 0, + $max_errors = null + ) { return $this->compileAll($smarty, $extension, $force_compile, $time_limit, $max_errors); } @@ -43,21 +45,22 @@ class Smarty_Internal_Method_CompileAllTemplates * Compile all template or config files * * @param \Smarty $smarty - * @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 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 bool $isConfig flag true if called for config files * * @return int number of template files compiled */ - protected function compileAll(Smarty $smarty, - $extension, - $force_compile, - $time_limit, - $max_errors, - $isConfig = false) - { + protected function compileAll( + Smarty $smarty, + $extension, + $force_compile, + $time_limit, + $max_errors, + $isConfig = false + ) { // switch off time limit if (function_exists('set_time_limit')) { @set_time_limit($time_limit); @@ -67,15 +70,18 @@ class Smarty_Internal_Method_CompileAllTemplates $sourceDir = $isConfig ? $smarty->getConfigDir() : $smarty->getTemplateDir(); // loop over array of source directories foreach ($sourceDir as $_dir) { - $_dir_1 = new RecursiveDirectoryIterator($_dir, defined('FilesystemIterator::FOLLOW_SYMLINKS') ? - FilesystemIterator::FOLLOW_SYMLINKS : 0); + $_dir_1 = new RecursiveDirectoryIterator( + $_dir, + defined('FilesystemIterator::FOLLOW_SYMLINKS') ? + FilesystemIterator::FOLLOW_SYMLINKS : 0 + ); $_dir_2 = new RecursiveIteratorIterator($_dir_1); foreach ($_dir_2 as $_fileinfo) { $_file = $_fileinfo->getFilename(); if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) { continue; } - if (!substr_compare($_file, $extension, -strlen($extension)) === 0) { + if (substr_compare($_file, $extension, -strlen($extension)) !== 0) { continue; } if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) { @@ -105,8 +111,7 @@ class Smarty_Internal_Method_CompileAllTemplates echo ' is up to date'; flush(); } - } - catch (Exception $e) { + } catch (Exception $e) { echo "\n<br> ------>Error: ", $e->getMessage(), "<br><br>\n"; $_error_count++; } @@ -122,4 +127,4 @@ class Smarty_Internal_Method_CompileAllTemplates echo "\n<br>"; return $_count; } -}
\ No newline at end of file +} |