Skip to content

Commit 146130b

Browse files
committed
Merge branch 'midwest-php'
2 parents 1d6e676 + e2323af commit 146130b

16 files changed

+69
-58
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ This presentation also has [a companion repository, full of executable examples
2929

3030
## Presentation History
3131

32-
* [WavePHP 2018](https://wavephp.com/) — September 20, 2018 ([join.in](https://joind.in/talk/6908c), [PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/wavephp-2018/slides.pdf))
33-
* [Southeast PHP](https://southeastphp.com/) - August 17, 2018 ([PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/southeastphp-2018/slides.pdf), [joind.in](https://joind.in/talk/ed2e4))
34-
* [PHPDetroit](https://phpdetroit.io/) - July 28, 2018 ([PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/phpdetroit-2018/slides.pdf), [joind.in](https://joind.in/talk/e6d00))
35-
* [php[tek] 2018](https://tek18.phparch.com/speakers/steve-grunwell/) - May 31, 2018 ([PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/phptek-2018/slides.pdf), [joind.in](https://joind.in/talk/c6025))
32+
* [Midwest PHP 2019](https://2019.midwestphp.org/) — March 8, 2019 ([Joind.in](https://joind.in/talk/b9a05))
33+
* [WavePHP 2018](https://wavephp.com/) — September 20, 2018 ([Joind.in](https://joind.in/talk/6908c), [PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/wavephp-2018/slides.pdf))
34+
* [Southeast PHP](https://southeastphp.com/) - August 17, 2018 ([Joind.in](https://joind.in/talk/ed2e4), [PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/southeastphp-2018/slides.pdf))
35+
* [PHPDetroit](https://phpdetroit.io/) - July 28, 2018 ([Joind.in](https://joind.in/talk/e6d00), [PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/phpdetroit-2018/slides.pdf))
36+
* [php[tek] 2018](https://tek18.phparch.com/speakers/steve-grunwell/) - May 31, 2018 ([Joind.in](https://joind.in/talk/c6025), [PDF](https://github.com/stevegrunwell/building-for-php-cli/releases/download/phptek-2018/slides.pdf))
3637
* [Music City Code 2017](https://www.musiccitycode.com/) - June 3, 2017
3738
* [CodeMash 2017](http://www.codemash.org/) - January 13, 2017
38-
* [Nomad PHP (EU)](https://nomadphp.com/nomadphp-2016-12-eu/) – December 15, 2016 ([joind.in](https://joind.in/talk/dce28))
39-
* [php[tek] 2016](https://tek16.phparch.com/speakers/#66432) – May 27, 2016 ([joind.in](https://joind.in/talk/ce9a4))
40-
* [Columbus PHP Meetup](http://www.meetup.com/phpphp/events/229434721/) – April 13, 2016 ([joind.in](https://joind.in/talk/e9465))
39+
* [Nomad PHP (EU)](https://nomadphp.com/nomadphp-2016-12-eu/) – December 15, 2016 ([Joind.in](https://joind.in/talk/dce28))
40+
* [php[tek] 2016](https://tek16.phparch.com/speakers/#66432) – May 27, 2016 ([Joind.in](https://joind.in/talk/ce9a4))
41+
* [Columbus PHP Meetup](http://www.meetup.com/phpphp/events/229434721/) – April 13, 2016 ([Joind.in](https://joind.in/talk/e9465))

css/source/theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// ---------------------------------------------
1111

1212
// Include theme-specific fonts
13-
@import url('https://fonts.googleapis.com/css?family=Montserrat|Open+Sans');
13+
@import url('https://fonts.googleapis.com/css?family=Open+Sans|Paytone+One');
1414

1515
// Override theme settings (see ../../bower_components/reveal.js/css/theme/template/settings.scss)
1616
$backgroundColor: #fff;
@@ -20,7 +20,7 @@ $headingColor: #333;
2020

2121
$mainFontSize: 38px;
2222
$mainFont: 'Open Sans', sans-serif;
23-
$headingFont: Montserrat, 'Open Sans', sans-serif;
23+
$headingFont: 'Paytone One', 'Open Sans', sans-serif;
2424
$headingTextShadow: none;
2525
$headingLetterSpacing: normal;
2626
$headingTextTransform: uppercase;

css/theme.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* By Hakim El Hattab, http://hakim.se
55
*/
6-
@import url("https://fonts.googleapis.com/css?family=Montserrat|Open+Sans");
6+
@import url("https://fonts.googleapis.com/css?family=Open+Sans|Paytone+One");
77
section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 {
88
color: #fff; }
99

@@ -41,7 +41,7 @@ body {
4141
.reveal h6 {
4242
margin: 0 0 20px 0;
4343
color: #333;
44-
font-family: Montserrat, "Open Sans", sans-serif;
44+
font-family: "Paytone One", "Open Sans", sans-serif;
4545
font-weight: 400;
4646
line-height: 1.2;
4747
letter-spacing: normal;
@@ -334,7 +334,7 @@ body {
334334
clear: both;
335335
float: left;
336336
width: 35%;
337-
font-family: Montserrat, "Open Sans", sans-serif;
337+
font-family: "Paytone One", "Open Sans", sans-serif;
338338
text-align: right; }
339339
.slides dl dd {
340340
clear: right;

resources/emily.jpg

-1.37 MB
Binary file not shown.

slides/about-me.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

slides/emily.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

slides/environment-variables.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
### Environment Variables
22

33
```php
4-
$name = getenv('DEMO_NAME');
4+
$apiKey = getenv('API_KEY');
55

6-
if ($name) {
7-
printf('Hey, I recognize you, %s!' . PHP_EOL, $name);
8-
$name = sprintf('My old friend, %s!', $name);
6+
// It wasn't provided via environment variable.
7+
if (! $apiKey && ! empty($argv[1])) {
8+
$apiKey = $argv[1];
9+
}
910

10-
} else {
11-
echo "I don't know you, so I'll just call you Fred." . PHP_EOL;
12-
$name = 'Fred';
11+
// Neither environment nor argument.
12+
if (! $apiKey) {
13+
echo 'An API key must be provided!';
14+
exit(1);
1315
}
1416

15-
// Update DEMO_NAME and call the system's echo program.
16-
putenv('DEMO_NAME=' . $name);
17-
passthru('echo $DEMO_NAME');
17+
echo "API Key: $apiKey";
1818
```
1919

2020
Note:
2121

22-
Another neat trick is the ability to access environment variables from within your PHP script.
22+
Another neat trick is the ability to access environment variables from within your PHP script.
23+
24+
Can use both getenv() and putenv().

slides/environment-variables2.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
### Environment Variables
22

3-
`export DEMO_NAME="Steve"`
4-
```html
5-
> Hey, I recognize you, Steve!
6-
> My old friend, Steve!
3+
```sh
4+
$ API_KEY=abc123 php my-script.php
5+
6+
API Key: abc123
77
```
8+
<!-- .element: class="fragment" -->
9+
10+
```sh
11+
$ php my-script.php xyz789
812

9-
<br>Otherwise:
10-
```html
11-
> I don't know you, so I'll just call you Fred.
12-
> Fred
13+
API Key: xyz789
1314
```
15+
<!-- .element: class="fragment" -->
16+
17+
```sh
18+
$ API_KEY=abc123 php my-script.php xyz789
19+
20+
API Key: abc123
21+
```
22+
<!-- .element: class="fragment" -->
23+
24+
Note:
25+
26+
Since the script was checking for the environment variable first, that will take precedence when the script is run.

slides/escaping-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exec('greet-user ' . $name);
1515
```
1616
<!-- .element: class="fragment" data-fragment-index="1" -->
1717

18-
##### Much Better:
18+
Much Better:
1919
<!-- .element: class="fragment" data-fragment-index="2" -->
2020

2121
```php

slides/exit-codes2.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ if (! isset($argv['1'])) {
66
exit(1);
77
}
88

9-
// Do something awesome
9+
echo "Script ran!";
1010
```
1111

1212
```sh
1313
$ php my-script.php foo && echo "Success"
14+
> Script ran!
15+
> Success
16+
```
17+
<!-- .element: class="fragment" -->
18+
19+
```sh
1420
$ php my-script.php && echo "You will never see this"
21+
> Missing required argument!
1522
```
1623
<!-- .element: class="fragment" -->
1724

slides/list.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
[
22
"index.md",
3-
[
4-
"about-me.md",
5-
"emily.md"
6-
],
73
[
84
"why-the-cli.md",
95
"benefits.md",
@@ -42,10 +38,10 @@
4238
"escaping-shell-commands.md",
4339
"escapeshellcmd.md",
4440
"escaping-arguments.md",
45-
"environment-variables.md",
46-
"environment-variables2.md",
4741
"exit-codes.md",
4842
"exit-codes2.md",
43+
"environment-variables.md",
44+
"environment-variables2.md",
4945
"daemons.md"
5046
],
5147
[

slides/php-cli-tools-example2.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@
44
$ php examples/PHPCliToolsExample.php
55
```
66

7-
```html
8-
$ php examples/PHPCliToolsExample.php
9-
How high should I count? [10]: 5
10-
Shall I shout it? [y/N]y
11-
1!
7+
<pre class="hljs lang-html fragment"><code>How high should I count? [10]: 5</code><code class="fragment">Shall I shout it? [y/N]y</code><code class="fragment">1!
128
2!
139
3!
1410
4!
15-
5!
16-
```
17-
<!-- .element: class="fragment" -->
11+
5!</code></pre>

slides/php-sapi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ if ('cli' !== php_sapi_name()) {
99

1010
Note:
1111

12+
* Used to running in something like the fpm-fcgi SAPI for web requests.
1213
* Use the php_sapi_name() function or PHP_SAPI constant to determine the server API being used

slides/thank-you.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Thank You!
22

33
Steve Grunwell<br>
4-
[stevegrunwell.com](https://stevegrunwell.com)<br>
5-
[liquidweb.com](https://www.liquidweb.com)
4+
Senior Software Engineer, Liquid Web
65

7-
[stevegrunwell.com/slides/php-cli](https://stevegrunwell.com/slides/php-cli)<!-- .element: class="slides-link" -->
6+
<p class="slides-link">
7+
[stevegrunwell.com/slides/php-cli](https://stevegrunwell.com/slides/php-cli)<br>[joind.in/talk/b9a05](https://joind.in/talk/b9a05)
8+
</p>

slides/wp-cli-example.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ WP_CLI::add_command( 'example-command', 'Example_WP_CLI_Command' );
1313

1414
Note:
1515

16-
Looking at WP-CLI commands, they're registered using the WP_CLI::add_command() method.
16+
Looking at WP-CLI commands, they're registered using the WP_CLI::add_command() method.
17+
18+
Each command class will contain at least one public method, each of which will become sub-commands (e.g. "wp example-command some-function").

templates/_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
<!-- For syntax highlighting -->
20-
<link rel="stylesheet" href="bower_components/highlightjs/styles/zenburn.css">
20+
<link rel="stylesheet" href="bower_components/highlightjs/styles/github.css">
2121

2222
<!-- Printing and PDF exports -->
2323
<script>

0 commit comments

Comments
 (0)