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

Commit c4419b6

Browse files
committed
referencing the new classes in the code
1 parent 89ea81e commit c4419b6

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

core/lib/PatternLab/Snapshot.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@
1919
class Snapshot {
2020

2121
/**
22-
* Set-up a default var
22+
* Set-up default vars
2323
*/
2424
public function __construct($config) {
25-
$this->publicDir = __DIR__."/../../../".$config["publicDir"];
26-
$this->sourceDir = "/../../../".$config["sourceDir"]."/_patterns".DIRECTORY_SEPARATOR;
25+
$this->publicDir = __DIR__."/../../../".Config::$options["sourceDir"];
26+
$this->sourceDir = "/../../../".Config::$options["sourceDir"]."/_patterns".DIRECTORY_SEPARATOR;
2727
$this->snapshotsBase = $this->publicDir."/snapshots/";
2828
}
2929

3030
/**
31-
* Get the arguments that have been passed to the script via the commmand line
31+
* Take a snap shot of the public dir
32+
* @param {String} the directory where we wil be writing the snapshot
3233
*/
3334
public function takeSnapshot($dir) {
3435

@@ -80,7 +81,7 @@ public function takeSnapshot($dir) {
8081

8182
// iterate over all of the other files in the source directory
8283
$directoryIterator = new \RecursiveDirectoryIterator($this->publicDir);
83-
$filteredIterator = new SnapshotFilterIterator($directoryIterator);
84+
$filteredIterator = new FilterIterator($directoryIterator);
8485
$objects = new \RecursiveIteratorIterator($filteredIterator, \RecursiveIteratorIterator::SELF_FIRST);
8586

8687
// make sure dots are skipped
@@ -123,17 +124,14 @@ public function takeSnapshot($dir) {
123124

124125
$d = array("html" => $html);
125126

126-
$templateLoader = new TemplateLoader();
127-
$templateHelper = new TemplateHelper($this->sourceDir);
127+
TemplateHelper::setup();
128128

129129
// render the viewall template
130-
$v = $templateLoader->vanilla();
131-
$h = $v->render($templateHelper->mainPageHead);
132-
$f = $v->render($templateHelper->mainPageFoot);
130+
$h = Helper::$htmlLoader->render(Helper::$mainPageHead);
131+
$f = Helper::$htmlLoader->render(Helper::$mainPageFoot);
133132

134133
// render the snapshot page
135-
$m = $templateLoader->fileSystem();
136-
$r = $m->render('snapshot', $d);
134+
$r = Helper::$filesystemLoader->render("snapshot", $d);
137135
$r = $h.$r.$f;
138136

139137
file_put_contents($this->snapshotsBase."index.html",$r);

0 commit comments

Comments
 (0)