prefer DirectoryIterator for readability, also test jbo translation, log deletion errors

This commit is contained in:
El RIDO
2025-11-20 09:10:01 +01:00
parent 3146d41609
commit 348d36d6ee
4 changed files with 40 additions and 37 deletions
+3 -4
View File
@@ -67,10 +67,9 @@ class ViewTest extends TestCase
$page->assign('CSPHEADER', 'default-src \'none\'');
$page->assign('SRI', array());
$dir = dir(PATH . 'tpl');
while (false !== ($file = $dir->read())) {
if (substr($file, -4) === '.php') {
$template = substr($file, 0, -4);
foreach (new DirectoryIterator(PATH . 'tpl') as $file) {
if ($file->getExtension() === 'php') {
$template = $file->getBasename('.php');
ob_start();
$page->draw($template);
$this->_content[$template] = ob_get_contents();