Skip to content

Commit

Permalink
add utility to build Smarty_Internal_Testinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Nov 8, 2016
1 parent 7438ac3 commit e867ae1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
/.gitignore export-ignore
/.gitattributes export-ignore
/lexer/ export-ignore
/utilities/ export-ignore
30 changes: 30 additions & 0 deletions utilities/BuildExpectedFiles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Created by PhpStorm.
* User: Uwe Tews
* Date: 25.10.2015
* Time: 23:58
*/
$sysplugins = array();
$iterator = new DirectoryIterator(__DIR__ . '/../libs/sysplugins');
foreach ($iterator as $file) {
if (!$file->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);

0 comments on commit e867ae1

Please sign in to comment.