-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
320 lines (273 loc) · 14.9 KB
/
index.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Introduction to Composer - David Mosher</title>
<meta name="description" content="">
<meta name="author" content="David Mosher">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="revealjs/css/reveal.min.css">
<link rel="stylesheet" href="revealjs/css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="monokai.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="revealjs/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="revealjs/lib/js/html5shiv.js"></script>
<![endif]-->
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans|Audiowide);
* {
font-family: 'Open Sans', sans-serif;
}
</style>
</head>
<body>
<div id="small-logo" class="hide" style="font-size: 1.2em; color: #FFF; position: absolute; bottom: 15px; left: 15px; display: none; z-index: 1000">
<span style="font-family: 'Open Sans'; letter-spacing: -1px">Reno <span style="color: #7878A5; font-family: 'Audiowide'; letter-spacing: -1px;">php</span></span>
</div>
<div class="reveal">
<div class="slides">
<section>
<p style="font-size: 3em; font-family: 'Open Sans'; letter-spacing: -10px">Reno <span style="color: #7878A5; font-family: 'Audiowide'; letter-spacing: -10px; text-shadow: -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff, 1px 1px 0 #ffffff;">php</span></p>
<br>
<p style="font-size: 1.8em;">Introduction to Composer</p>
<p>
<small><a href="http://dmwc.biz">David Mosher</a> / <a href="http://twitter.com/arenowebdev">@arenowebdev</a></small>
</p>
</section>
<section>
<section>
<h1>What Is It?</h1>
</section>
<section data-background="#19242f">
<img src="composer-logo.png" style="border: none">
<blockquote style="padding: 25px">"[A] tool for dependency management in PHP"</blockquote>
</section>
<section data-background="#19242f">
<blockquote style="padding: 25px">"<span style="font-weight: bold; color: #b73234;">NOT</span> a package manager"</blockquote>
<br>
<p class="fragment">Cross-platform compatible requiring only > PHP version 5.3.2</p>
</section>
</section>
<section>
<section>
<h1>Why Should You Use It?</h1>
</section>
<section data-background="#6abcdd" style=" color: #19242f">
<ul>
<li>Ruby (Bundler), NodeJS (npm)<br><br></li>
<li class="fragment">Working with zip files sucks and increases risk<br><br></li>
<li class="fragment">Opens you up to the most annoying type of security issue…</li>
</ul>
</section>
<section data-background="#b73234">
<p style="font-size: 3em; font-weight: bold;">
Ones that have already been patched!
</p>
</section>
<section data-background="#35B832">
<ul>
<li>Decreases development time<br><br></li>
<li class="fragment">Easy access to libraries leads to more people re-using existing code<br><br></li>
<li class="fragment">Automatic dependency management encourages developers to publish new packages while relying on old (DRY)<br><br></li>
</ul>
</section>
<section data-background="#b73234">
<p style="font-size: 3em; font-weight: bold;">
You specify what your project needs are <em>in writing</em>
</p>
</section>
</section>
<section>
<section>
<h1>Installing It</h1>
</section>
<section data-background="#19242f">
<b>Locally</b> (only within your project)<br>
<pre><code class="bash" data-trim>$ curl -sS http://getcomposer.org/installer | php</code></pre>
<br>
<div class="fragment">
<b>Globally</b> (system wide - recommended)<br>
<pre><code class="bash" data-trim>$ sudo mv composer.phar /usr/local/bin/composer</code></pre>
</div>
<aside class="notes">
<ul>
<li>I'm only going to cover installing it on non-windows machines.</li>
</ul>
</aside>
</section>
</section>
<section>
<section>
<h1>Using It</h1>
</section>
<section data-background="#6abcdd">
<h2>The Basics</h2>
<div class="fragment">
<pre><code class="bash" data-trim>$ composer --version</code></pre>
</div>
<div class="fragment">
<pre><code class="bash" data-trim>$ composer
Warning: This development build of composer is over 30 days old. It is
recommended to update it by running "composer self-update" to get the
latest version.</code></pre>
<pre><code class="bash" data-trim>$ composer self-update</code></pre>
</div>
</section>
<section data-background="#b73234">
<h1>composer.json file</p>
</section>
<section data-background="#19242f">
<pre><code class="jacascript" data-trim>{
"name": "My Simple Laravel Project",
"require": {
"laravel/laravel": "v4.0.0"
},
"authors": [
{
"name": "David Mosher",
"email": "[email protected]"
}
]
}</code></pre>
</section>
<section data-background="#19242f">
<img src="all-the-things.jpg">
<pre><code class="bash" data-trim>$ composer install</code></pre>
</section>
<section data-background="#b73234">
<h2>Finding Packages</h2>
</section>
<section data-background="#19242f">
<p>Packagist.org</p>
<img src="https://tutsplus.s3.amazonaws.com/tutspremium/web-development/180_Laravel4/images/packagist.png">
</section>
<section data-background="#b73234">
You are able to utilize your own packages hosted in version control (both private and public!)
<pre><code data-trim>{
"repositories": [
{
"type": "vcs",
"url": "https://[email protected]/dmosher/presentation.git"
}
]
}</code></pre>
</section>
<section data-background="#b73234">
<h2>Version Constraints</h2>
<ul style="width: 500px">
<li class="fragment">Exact Version<br>
<pre><code>1.0.3</code></pre>
</li>
<li class="fragment">Range<br>
<pre><code>>=1.0
>=1.2,<2.0</code></pre>
</li>
<li class="fragment">Wildcard<br>
<pre><code>1.0.*</code></pre>
</li>
<li class="fragment">Next Significant Release<br>
<pre><code>~1.2</code></pre>
<div class="fragment">
<pre><code>~1.2.3</code></pre>
</div>
</li>
</ul>
</section>
<section data-background="#19242f">
<p style="font-size: 2em">Platform (Virtual) Packages</p>
<ul>
<li class="fragment">PHP Version<br><span style="font-size: .9em">Allows you to apply constraints on the PHP version</span><br><pre><code data-trim class="bash">"php": ">=5.3.2"</code></pre><br></li>
<li class="fragment">PHP Extension<br><span style="font-size: .9em">Allows requiring of PHP extensions</span><br><pre><code data-trim class="bash">"ext-gd": "*"</code></pre><br></li>
<li class="fragment">PHP Library<br><span style="font-size: .9em">Allows version constraints of PHP libraries</span><br><pre><code data-trim class="bash">"lib-curl": ">=7.3"</code></pre><br></li>
</ul>
</section>
</section>
<section>
<section>
<h2>Fruits of Our Labor</h2>
<h1 class="fragment">Autoloading</h1>
</section>
<section data-background="#b73234">
<blockquote style="padding: 50px" cite="http://getcomposer.org/doc/00-intro.md#autoloading">"Besides downloading the libraries outlined in your composer.json file, Composer also prepares an autoload file that's capable of autoloading all of those classes in any of the libraries it downloaded."</blockquote>
</section>
<section data-background="#6abcdd" style="color: #19242f">
<pre><code class="php" data-trim><?php
require 'vendor/autoload.php';</code></pre><br>
<p class="fragment" style="font-weight: bold">You now have full access to any of the namespaced classes!</p>
</section>
<section data-background="#19242f">
<p style="text-align: left">PSR-0<br><pre><code class="javascript" data-trim>"autoload": {
"psr-0": { "Mosher\\Presentation\\": "src/" }
}</code></pre></p>
<div class="fragment">
<p style="text-align: left">Classmap<br><pre><code class="javascript" data-trim>"autoload": {
"classmap": [ "lib/", "ext/library.php" ]
}</code></pre></p>
</div>
<div class="fragment">
<p style="text-align: left">Directories / Individual Files<br><pre><code class="javascript" data-trim>"autoload": {
"files": [ "ext/functions.php" ]
}</code></pre></p>
</div>
</section>
</section>
<!-- <section>
<section>
<h1>Let's Build Something</h1>
</section>
</section> -->
<section data-background="blake.jpg">
<div style="position: absolute !important; top: 0px !important; right: 0px !important;">
<h1>Thank you!</h1>
<p>
<small><a href="http://dmwc.biz" style="color: #FFF">David Mosher</a> / <a href="http://twitter.com/arenowebdev" style="color: #FFF">@arenowebdev</a></small>
</p>
</div>
</section>
</div>
</div>
<script src="revealjs/lib/js/head.min.js"></script>
<script src="revealjs/js/reveal.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: 'linear',
// Parallax scrolling
//parallaxBackgroundImage: 'background.jpg',
//parallaxBackgroundImage: 'http://renophp.dmwc.biz/assets/img/reno.jpg',
parallaxBackgroundImage: 'emerald-bay-wide.jpg',
//parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
parallaxBackgroundSize: '2560px 1095px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'revealjs/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'revealjs/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'revealjs/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
Reveal.addEventListener( 'slidechanged', function(event) {
if (event.indexh > 0) {
$('#small-logo').fadeIn('slow');
} else {
$('#small-logo').fadeOut('fast');
}
});
</script>
</body>
</html>