From c976fa4cbffac7a67c41df43f47899d09a965a49 Mon Sep 17 00:00:00 2001 From: Dave Olsen Date: Thu, 28 Jul 2016 17:12:01 -0400 Subject: [PATCH 1/4] making sure pattern type properly loads globalData var --- src/PatternLab/Builder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PatternLab/Builder.php b/src/PatternLab/Builder.php index a869e329..fb91068f 100644 --- a/src/PatternLab/Builder.php +++ b/src/PatternLab/Builder.php @@ -391,8 +391,8 @@ protected function generateViewAllPages() { $patternData["patternPartial"] = "viewall-".$patternStoreData["nameDash"]."-all"; // add the pattern lab specific mark-up - $partials["patternLabHead"] = $stringLoader->render(array("string" => $htmlHead, "data" => array("cacheBuster" => $partials["cacheBuster"]))); - $partials["patternLabFoot"] = $stringLoader->render(array("string" => $htmlFoot, "data" => array("cacheBuster" => $partials["cacheBuster"], "patternData" => json_encode($patternData)))); + $globalData["patternLabHead"] = $stringLoader->render(array("string" => $htmlHead, "data" => array("cacheBuster" => $partials["cacheBuster"]))); + $globalData["patternLabFoot"] = $stringLoader->render(array("string" => $htmlFoot, "data" => array("cacheBuster" => $partials["cacheBuster"], "patternData" => json_encode($patternData)))); // render the parts and join them $header = $patternLoader->render(array("pattern" => $patternHead, "data" => $globalData)); From 7dd6d483c69b4684173247f9673e907621311af4 Mon Sep 17 00:00:00 2001 From: Dave Olsen Date: Thu, 28 Jul 2016 17:21:37 -0400 Subject: [PATCH 2/4] install assets and save path appropriately --- src/PatternLab/InstallerUtil.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php index 66a3fab5..fb934e4f 100644 --- a/src/PatternLab/InstallerUtil.php +++ b/src/PatternLab/InstallerUtil.php @@ -349,14 +349,15 @@ protected static function parseComponentList($packageName,$sourceBase,$destinati // iterate over the returned objects foreach ($finder as $file) { - $ext = $file->getExtension(); + $ext = $file->getExtension(); + $pathName = $file->getPathname()); if ($ext == "css") { - $componentTypes["stylesheets"][] = str_replace($sourceBase.$source,$destination,$file->getPathname()); + $componentTypes["stylesheets"][] = str_replace(DIRECTORY_SEPARATOR,"/",str_replace($sourceBase.$source,$destination,$pathName)); } else if ($ext == "js") { - $componentTypes["javascripts"][] = str_replace($sourceBase.$source,$destination,$file->getPathname()); + $componentTypes["javascripts"][] = str_replace(DIRECTORY_SEPARATOR,"/",str_replace($sourceBase.$source,$destination,$pathName)); } else if ($ext == $templateExtension) { - $componentTypes["templates"][] = str_replace($sourceBase.$source,$destination,$file->getPathname()); + $componentTypes["templates"][] = str_replace(DIRECTORY_SEPARATOR,"/",str_replace($sourceBase.$source,$destination,$pathName)); } } From 884c9952ccba72e3b42afd29840a42f642e22a41 Mon Sep 17 00:00:00 2001 From: Evan Lovely Date: Mon, 31 Oct 2016 12:23:36 -0700 Subject: [PATCH 3/4] Updating global data to use `yml` or `yaml` --- src/PatternLab/Data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PatternLab/Data.php b/src/PatternLab/Data.php index e0da3fc7..75b05654 100644 --- a/src/PatternLab/Data.php +++ b/src/PatternLab/Data.php @@ -125,7 +125,7 @@ public static function gather($options = array()) { $pathName = $file->getPathname(); $pathNameClean = str_replace($sourceDir."/","",$pathName); - if (!$hidden && (($ext == "json") || ($ext == "yaml"))) { + if (!$hidden && (($ext == "json") || ($ext == "yaml") || ($ext == "yml"))) { if ($isListItems === false) { @@ -137,7 +137,7 @@ public static function gather($options = array()) { JSON::lastErrorMsg($pathNameClean,$jsonErrorMessage,$data); } - } else if ($ext == "yaml") { + } else if (($ext == "yaml") || ($ext == "yml")) { $file = file_get_contents($pathName); From 44c0dd0caa5ddd63a7b298ab594d3f948a08da31 Mon Sep 17 00:00:00 2001 From: Salem Ghoweri Date: Thu, 27 Apr 2017 13:31:04 -0400 Subject: [PATCH 4/4] Fixing extra closing parentheses so dev branch works. Addresses https://github.com/pattern-lab/patternlab-php-core/pull/87 --- src/PatternLab/InstallerUtil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PatternLab/InstallerUtil.php b/src/PatternLab/InstallerUtil.php index fb934e4f..fcc7fa99 100644 --- a/src/PatternLab/InstallerUtil.php +++ b/src/PatternLab/InstallerUtil.php @@ -350,7 +350,7 @@ protected static function parseComponentList($packageName,$sourceBase,$destinati foreach ($finder as $file) { $ext = $file->getExtension(); - $pathName = $file->getPathname()); + $pathName = $file->getPathname(); if ($ext == "css") { $componentTypes["stylesheets"][] = str_replace(DIRECTORY_SEPARATOR,"/",str_replace($sourceBase.$source,$destination,$pathName));