From e867ae125e95ff629eb3b748eb222200f50e1769 Mon Sep 17 00:00:00 2001 From: uwetews Date: Tue, 8 Nov 2016 18:09:14 +0100 Subject: [PATCH] add utility to build Smarty_Internal_Testinstall --- .gitattributes | 1 + utilities/BuildExpectedFiles.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 utilities/BuildExpectedFiles.php diff --git a/.gitattributes b/.gitattributes index b3917246..6ea6cbe8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -28,3 +28,4 @@ /.gitignore export-ignore /.gitattributes export-ignore /lexer/ export-ignore +/utilities/ export-ignore diff --git a/utilities/BuildExpectedFiles.php b/utilities/BuildExpectedFiles.php new file mode 100644 index 00000000..b6c368d8 --- /dev/null +++ b/utilities/BuildExpectedFiles.php @@ -0,0 +1,30 @@ +isDot() && 'php' == $file->getExtension()) { + $filename = $file->getBasename(); + $sysplugins[ $filename ] = true; + } +} +$plugins = array(); +$iterator = new DirectoryIterator(__DIR__ . '/../libs/plugins'); +foreach ($iterator as $file) { + if (!$file->isDot() && 'php' == $file->getExtension()) { + $filename = $file->getBasename(); + $plugins[ $filename ] = true; + } +} +$code = file_get_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php'); +$expectedPlugins = '$expectedPlugins = ' . var_export($plugins, true); +$code = preg_replace('#\$expectedPlugins =[^;]+#', $expectedPlugins, $code); +$expectedSysplugins = '$expectedSysplugins = ' . var_export($sysplugins, true); +$code = preg_replace('#\$expectedSysplugins =[^;]+#', $expectedSysplugins, $code); +file_put_contents(__DIR__ . '/../libs/sysplugins/smarty_internal_testinstall.php', $code); +