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

Commit 0ae0992

Browse files
committed
referencing new classes & config
1 parent c4419b6 commit 0ae0992

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

core/lib/PatternLab/StarterKit.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab StartKit Class - v0.7.12
4+
* StarterKit Class
55
*
66
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license
@@ -12,14 +12,16 @@
1212

1313
namespace PatternLab;
1414

15+
use \Alchemy\Zippy\Zippy;
16+
use \PatternLab\Config;
17+
1518
class StarterKit {
1619

1720
/**
1821
* Set-up a default var
1922
*/
20-
public function __construct($config) {
21-
$this->sourceDir = __DIR__."/../../../".$config["sourceDir"];
22-
if (!is_dir($this->sourceDir)) {
23+
public function __construct() {
24+
if (!is_dir(Config::$options["sourceDir"])) {
2325
print "Check to make sure your source directory is configured properly...\n";
2426
exit;
2527
}
@@ -60,7 +62,7 @@ public function fetch($starterKit) {
6062

6163
// see if the source directory is empty
6264
$emptyDir = true;
63-
$objects = new \DirectoryIterator($this->sourceDir);
65+
$objects = new \DirectoryIterator(Config::$options["sourceDir"]);
6466
foreach ($objects as $object) {
6567
if (!$object->isDot() && ($object->getFilename() != "README") && ($object->getFilename() != ".DS_Store")) {
6668
$emptyDir = false;
@@ -79,7 +81,7 @@ public function fetch($starterKit) {
7981

8082
print "nuking everything in source/...\n";
8183

82-
$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->sourceDir), \RecursiveIteratorIterator::CHILD_FIRST);
84+
$objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Config::$options["sourceDir"]), \RecursiveIteratorIterator::CHILD_FIRST);
8385

8486
// make sure dots are skipped
8587
$objects->setFlags(\FilesystemIterator::SKIP_DOTS);
@@ -103,10 +105,10 @@ public function fetch($starterKit) {
103105
}
104106

105107
// extract
106-
$zippy = \Alchemy\Zippy\Zippy::load();
108+
$zippy = Zippy::load();
107109
$zipAdapter = $zippy->getAdapterFor('tar.gz');
108110
$archiveZip = $zipAdapter->open($tempFile);
109-
$archiveZip = $archiveZip->extract($this->sourceDir);
111+
$archiveZip = $archiveZip->extract(Config::$options["sourceDir"]);
110112

111113
// remove the temp file
112114
unlink($tempFile);

0 commit comments

Comments
 (0)