-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (90 loc) · 4.74 KB
/
index.html
File metadata and controls
110 lines (90 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="theme-color" content="#a32d32">
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>junty</title>
<link rel="stylesheet" href="public/dist/css/main.css" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'>
<link rel="icon" type="image/png" href="public/images/favicon.png" />
<meta property="og:locale" content="en_US">
<meta property="og:url" content="http://the-junty.github.io">
<meta property="og:title" content="junty">
<meta property="og:site_name" content="junty">
<meta property="og:description" content="Automation for streams handling with tasks for PHP 7">
<meta property="og:image" content="http://the-junty.github.io/public/images/logo.png">
<meta property="og:image:type" content="image/png">
<meta property="og:type" content="website">
<script src="public/dist/js/main.js"></script>
</head>
<body>
<div class="div30px"></div>
<nav>
</nav>
<header>
</header>
<main>
<div class="console">
<div class="title">
<span class="text">juntyfile.php</span>
</div>
<div class="body">
<pre class="text">
<?php
<span class="keyword">require</span> <span class="string">'vendor/autoload.php'</span>;
<span class="keyword">use</span> Junty\Runner\JuntyRunner;
<span class="keyword">use</span> Gabrieljmj\JuntyMinify\{Css <span class="keyword">as</span> CssMinifier, Js <span class="keyword">as</span> JsMinifier};
<span class="variable">$junty</span> = <span class="keyword">new</span> JuntyRunner();
<span class="variable">$junty</span>->group(<span class="string">'minify'</span>, <span class="keyword">function</span> () {
<span class="variable">$this</span>->task(<span class="string">'css'</span>, <span class="keyword">function</span> () {
<span class="variable">$this</span>->src(<span class="string">'./public/css/*.css'</span>)
->forStreams(<span class="keyword">new</span> CssMinifier())
->forStreams(<span class="variable">$this</span>->toDir(<span class="string">'public/dist/css'</span>));
});
<span class="variable">$this</span>->task(<span class="string">'js'</span>, <span class="keyword">function</span> () {
<span class="variable">$this</span>->src(<span class="string">'./public/js/*.js'</span>)
->forStreams(<span class="keyword">new</span> JsMinifier())
->forStreams(<span class="variable">$this</span>->toDir(<span class="string">'public/dist/js'</span>));
});
});
<span class="variable">$junty</span>->task(<span class="string">'zip'</span>, <span class="keyword">function</span> () {
<span class="variable">$this</span>->src(<span class="string">'./*'</span>)
->forStreams(<span class="keyword">function</span> (<span class="keyword">array</span> <span class="variable">$streams</span>) {
<span class="variable">$zip</span> = <span class="keyword">new</span> ZipArchive();
<span class="keyword">if</span> (<span class="variable">$zip</span>->open(<span class="string">'dest.zip'</span>, ZipArchive::<span class="variable">CREATE</span>)) {
<span class="keyword">foreach</span> (<span class="variable">$streams</span> <span class="keyword">as</span> <span class="variable">$stream</span>) {
<span class="variable">$zip</span>->addFromString(
<span class="variable">$stream</span>->getMetaData(<span class="string">'uri'</span>),
<span class="variable">$stream</span>->getContents()
);
}
<span class="variable">$zip</span>->close();
}
});
});
<span class="keyword">return</span> <span class="variable">$junty</span>;</pre>
</div>
</div>
<div class="div10px"></div>
<div class="console">
<div class="title">
<span class="text">junty-execution-example</span>
</div>
<div class="body">
<code class="text">
$ vendor/bin/junty run<br>
Executing tasks<br>
Executing group 'minify'<br>
--Executing task 'css'<br>
--Executing task 'js'<br>
Executing task 'zip'<br>
Finished! Time: 200ms
</code>
</div>
</div>
</main>
<footer>
</footer>
</body>
</html>