Skip to content

Commit 78bebde

Browse files
author
Evan Willhite
committed
tweaked for emulsify
1 parent c0fa939 commit 78bebde

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/TwigExtension/ExtensionLoader.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@ static protected function loadAll($type) {
4848
$themeLocation = drupal_get_path('theme', $theme);
4949
$fullPath = DRUPAL_ROOT . '/' . $themeLocation . '/' . 'pattern-lab/source/_twig-components/';
5050

51-
$fullPathAlt = DRUPAL_ROOT . '/' . $themeLocation . '/' . 'source/_twig-components/';
51+
$fullPathAlt = DRUPAL_ROOT . '/' . $themeLocation . '/' . 'components/_twig-components/';
5252

5353
if (file_exists($fullPathAlt)){
5454
$fullPath = $fullPathAlt;
5555
}
5656

5757
foreach (scandir($fullPath . $type) as $file) {
58-
if ($file[0] != '.' && $file[0] != '_') {
59-
// print_r($file);
60-
static::load($type, $fullPath . $type . '/' . $file);
58+
$fileInfo = pathinfo($file);
59+
if ($fileInfo['extension'] === 'php') {
60+
if ($file[0] != '.' && $file[0] != '_' && substr($file, 0, 2) != 'd_') {
61+
static::load($type, $fullPath . $type . '/' . $file);
62+
}
6163
}
6264
}
6365
}

0 commit comments

Comments
 (0)