Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit b5db98d

Browse files
committed
more fixes for windows
1 parent 573475b commit b5db98d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

core/lib/Mustache/Loader/PatternLoader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function loadFile($name)
109109

110110
// get the real file path for the pattern
111111
$fileName = $this->getFileName($partialName);
112-
112+
//print $fileName."\n";
113113
// throw error if path is not found
114114
if (!file_exists($fileName)) {
115115
throw new Mustache_Exception_UnknownTemplateException($name);
@@ -143,29 +143,29 @@ protected function getFileName($name)
143143
{
144144

145145
$fileName = "";
146-
146+
$dirSep = DIRECTORY_SEPARATOR;
147147
// test to see what kind of path was supplied
148148
$posDash = strpos($name,"-");
149-
$posSlash = strpos($name,"/");
149+
$posSlash = strpos($name,$dirSep);
150150
if (($posSlash === false) && ($posDash !== false)) {
151151

152152
list($patternType,$pattern) = $this->getPatternInfo($name);
153153

154154
// see if the pattern is an exact match for patternPaths. if not iterate over patternPaths to find a likely match
155155
if (isset($this->patternPaths[$patternType][$pattern])) {
156-
$fileName = $this->baseDir."/".$this->patternPaths[$patternType][$pattern]["patternSrcPath"];
156+
$fileName = $this->baseDir.$dirSep.$this->patternPaths[$patternType][$pattern]["patternSrcPath"];
157157
} else if (isset($this->patternPaths[$patternType])) {
158158
foreach($this->patternPaths[$patternType] as $patternMatchKey=>$patternMatchValue) {
159159
$pos = strpos($patternMatchKey,$pattern);
160160
if ($pos !== false) {
161-
$fileName = $this->baseDir."/".$patternMatchValue["patternSrcPath"];
161+
$fileName = $this->baseDir.$dirSep.$patternMatchValue["patternSrcPath"];
162162
break;
163163
}
164164
}
165165
}
166166

167167
} else {
168-
$fileName = $this->baseDir."/".$name;
168+
$fileName = $this->baseDir.$dirSep.$name;
169169
}
170170

171171
if (substr($fileName, 0 - strlen($this->extension)) !== $this->extension) {

core/lib/PatternLab/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ protected function gatherPatternInfo() {
595595
$pattern = str_replace(".mustache","",$patternFull); // 00-colors
596596

597597
if ($patternSubtypeSet) {
598-
$patternPath = $patternType."/".$patternSubtype."/".$pattern; // 00-atoms/01-global/00-colors
598+
$patternPath = $patternType.$dirSep.$patternSubtype.$dirSep.$pattern; // 00-atoms/01-global/00-colors
599599
$patternPathDash = str_replace($dirSep,"-",$patternPath); // 00-atoms-01-global-00-colors (file path)
600600
} else {
601601
$patternPath = $patternType.$dirSep.$pattern; // 00-atoms/00-colors

core/lib/PatternLab/Generator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function generate($enableCSS = false) {
5656

5757
// gather all of the various pattern info
5858
$this->gatherPatternInfo();
59-
59+
60+
6061
// clean the public directory to remove old files
6162
if ($this->cleanPublic == "true") {
6263
$this->cleanPublic();

0 commit comments

Comments
 (0)