Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 19469a2

Browse files
committed
Merge branch 'hotfix/69'
Close #69
2 parents 4e1f63b + 8cdc702 commit 19469a2

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

bin/templatemap_generator.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,29 +121,27 @@
121121
: $template;
122122

123123
$template = preg_replace('#^\.*/#', '', $template);
124-
$file = sprintf('__DIR__ . \'/%s\'', $file);
125124

126-
return sprintf(" '%s' => %s,\n", $template, $file);
125+
return sprintf(" '%s' => __DIR__ . '/%s',", $template, $file);
127126
}, $files);
128127

129128
echo '<' . "?php\nreturn [\n"
130-
. implode('', $entries)
129+
. implode("\n", $entries) . "\n"
131130
. '];';
132131

133132
exit(0);
134133

135134
function findTemplateFilesInTemplatePath($templatePath)
136135
{
137-
$rdi = new RecursiveDirectoryIterator($templatePath, RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
136+
$rdi = new RecursiveDirectoryIterator(
137+
$templatePath,
138+
RecursiveDirectoryIterator::FOLLOW_SYMLINKS | RecursiveDirectoryIterator::SKIP_DOTS
139+
);
138140
$rii = new RecursiveIteratorIterator($rdi, RecursiveIteratorIterator::LEAVES_ONLY);
139141

140142
$files = [];
141143
foreach ($rii as $file) {
142-
if (! $file instanceof SplFileInfo) {
143-
continue;
144-
}
145-
146-
if (! preg_match('#^phtml$#i', $file->getExtension())) {
144+
if (strtolower($file->getExtension()) != 'phtml') {
147145
continue;
148146
}
149147

0 commit comments

Comments
 (0)