Skip to content

Commit 1fa44ec

Browse files
authored
Merge pull request #10 from drupal-pattern-lab/feature/follow-symlinks
Allow Pattern Lab to follow pattern symlinks when registering patterns
2 parents 2db3557 + 60fc319 commit 1fa44ec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/PatternLab/PatternData.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ public static function gather($options = array()) {
116116
if (!is_dir(Config::getOption("patternSourceDir"))) {
117117
Console::writeError("having patterns is important. please make sure you've installed a starterkit and/or that ".Console::getHumanReadablePath(Config::getOption("patternSourceDir"))." exists...");
118118
}
119-
$patternObjects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Config::getOption("patternSourceDir")), \RecursiveIteratorIterator::SELF_FIRST);
120-
$patternObjects->setFlags(\FilesystemIterator::SKIP_DOTS);
119+
120+
$patternSourceDir = Config::getOption("patternSourceDir");
121+
$patternObjects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($patternSourceDir, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS | \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
121122

122123
// sort the returned objects
123124
$patternObjects = iterator_to_array($patternObjects);
124125
ksort($patternObjects);
125126

126-
$patternSourceDir = Config::getOption("patternSourceDir");
127-
128127
foreach ($patternObjects as $name => $object) {
129128

130129
$ext = $object->getExtension();

0 commit comments

Comments
 (0)