diff --git a/README.md b/README.md index 333a839..3ecd94c 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,13 @@ This presentation also has [a companion repository, full of executable examples ## Presentation History -* [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)) -* [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)) -* [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)) -* [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)) +* [Midwest PHP 2019](https://2019.midwestphp.org/) — March 8, 2019 ([Joind.in](https://joind.in/talk/b9a05)) +* [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)) +* [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)) +* [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)) +* [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)) * [Music City Code 2017](https://www.musiccitycode.com/) - June 3, 2017 * [CodeMash 2017](http://www.codemash.org/) - January 13, 2017 -* [Nomad PHP (EU)](https://nomadphp.com/nomadphp-2016-12-eu/) – December 15, 2016 ([joind.in](https://joind.in/talk/dce28)) -* [php[tek] 2016](https://tek16.phparch.com/speakers/#66432) – May 27, 2016 ([joind.in](https://joind.in/talk/ce9a4)) -* [Columbus PHP Meetup](http://www.meetup.com/phpphp/events/229434721/) – April 13, 2016 ([joind.in](https://joind.in/talk/e9465)) +* [Nomad PHP (EU)](https://nomadphp.com/nomadphp-2016-12-eu/) – December 15, 2016 ([Joind.in](https://joind.in/talk/dce28)) +* [php[tek] 2016](https://tek16.phparch.com/speakers/#66432) – May 27, 2016 ([Joind.in](https://joind.in/talk/ce9a4)) +* [Columbus PHP Meetup](http://www.meetup.com/phpphp/events/229434721/) – April 13, 2016 ([Joind.in](https://joind.in/talk/e9465)) diff --git a/css/source/theme.scss b/css/source/theme.scss index 95d3ee3..70e22c0 100644 --- a/css/source/theme.scss +++ b/css/source/theme.scss @@ -10,7 +10,7 @@ // --------------------------------------------- // Include theme-specific fonts -@import url('https://fonts.googleapis.com/css?family=Montserrat|Open+Sans'); +@import url('https://fonts.googleapis.com/css?family=Open+Sans|Paytone+One'); // Override theme settings (see ../../bower_components/reveal.js/css/theme/template/settings.scss) $backgroundColor: #fff; @@ -20,7 +20,7 @@ $headingColor: #333; $mainFontSize: 38px; $mainFont: 'Open Sans', sans-serif; -$headingFont: Montserrat, 'Open Sans', sans-serif; +$headingFont: 'Paytone One', 'Open Sans', sans-serif; $headingTextShadow: none; $headingLetterSpacing: normal; $headingTextTransform: uppercase; diff --git a/css/theme.css b/css/theme.css index 5dbad79..2e58d0a 100644 --- a/css/theme.css +++ b/css/theme.css @@ -3,7 +3,7 @@ * * By Hakim El Hattab, http://hakim.se */ -@import url("https://fonts.googleapis.com/css?family=Montserrat|Open+Sans"); +@import url("https://fonts.googleapis.com/css?family=Open+Sans|Paytone+One"); 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 { color: #fff; } @@ -41,7 +41,7 @@ body { .reveal h6 { margin: 0 0 20px 0; color: #333; - font-family: Montserrat, "Open Sans", sans-serif; + font-family: "Paytone One", "Open Sans", sans-serif; font-weight: 400; line-height: 1.2; letter-spacing: normal; @@ -334,7 +334,7 @@ body { clear: both; float: left; width: 35%; - font-family: Montserrat, "Open Sans", sans-serif; + font-family: "Paytone One", "Open Sans", sans-serif; text-align: right; } .slides dl dd { clear: right; diff --git a/resources/emily.jpg b/resources/emily.jpg deleted file mode 100644 index 290757d..0000000 Binary files a/resources/emily.jpg and /dev/null differ diff --git a/slides/about-me.md b/slides/about-me.md deleted file mode 100644 index 0ed6d2d..0000000 --- a/slides/about-me.md +++ /dev/null @@ -1,5 +0,0 @@ -## Who am I? - -* Senior Software Engineer @ [Liquid Web](https://www.liquidweb.com) -* Open-source contributor -* Husband + toddler wrangler diff --git a/slides/emily.md b/slides/emily.md deleted file mode 100644 index babe8d8..0000000 --- a/slides/emily.md +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/slides/environment-variables.md b/slides/environment-variables.md index 679e8b0..c3d52d2 100644 --- a/slides/environment-variables.md +++ b/slides/environment-variables.md @@ -1,22 +1,24 @@ ### Environment Variables ```php -$name = getenv('DEMO_NAME'); +$apiKey = getenv('API_KEY'); -if ($name) { - printf('Hey, I recognize you, %s!' . PHP_EOL, $name); - $name = sprintf('My old friend, %s!', $name); +// It wasn't provided via environment variable. +if (! $apiKey && ! empty($argv[1])) { + $apiKey = $argv[1]; +} -} else { - echo "I don't know you, so I'll just call you Fred." . PHP_EOL; - $name = 'Fred'; +// Neither environment nor argument. +if (! $apiKey) { + echo 'An API key must be provided!'; + exit(1); } -// Update DEMO_NAME and call the system's echo program. -putenv('DEMO_NAME=' . $name); -passthru('echo $DEMO_NAME'); +echo "API Key: $apiKey"; ``` Note: -Another neat trick is the ability to access environment variables from within your PHP script. \ No newline at end of file +Another neat trick is the ability to access environment variables from within your PHP script. + +Can use both getenv() and putenv(). diff --git a/slides/environment-variables2.md b/slides/environment-variables2.md index ff861b1..72c4098 100644 --- a/slides/environment-variables2.md +++ b/slides/environment-variables2.md @@ -1,13 +1,26 @@ ### Environment Variables -`export DEMO_NAME="Steve"` -```html -> Hey, I recognize you, Steve! -> My old friend, Steve! +```sh +$ API_KEY=abc123 php my-script.php + +API Key: abc123 ``` + + +```sh +$ php my-script.php xyz789 -
Otherwise: -```html -> I don't know you, so I'll just call you Fred. -> Fred +API Key: xyz789 ``` + + +```sh +$ API_KEY=abc123 php my-script.php xyz789 + +API Key: abc123 +``` + + +Note: + +Since the script was checking for the environment variable first, that will take precedence when the script is run. diff --git a/slides/escaping-arguments.md b/slides/escaping-arguments.md index 20c8cbb..3fca0d3 100644 --- a/slides/escaping-arguments.md +++ b/slides/escaping-arguments.md @@ -15,7 +15,7 @@ exec('greet-user ' . $name); ``` -##### Much Better: +Much Better: ```php diff --git a/slides/exit-codes2.md b/slides/exit-codes2.md index 1ed0fac..5312321 100644 --- a/slides/exit-codes2.md +++ b/slides/exit-codes2.md @@ -6,12 +6,19 @@ if (! isset($argv['1'])) { exit(1); } -// Do something awesome +echo "Script ran!"; ``` ```sh $ php my-script.php foo && echo "Success" +> Script ran! +> Success +``` + + +```sh $ php my-script.php && echo "You will never see this" +> Missing required argument! ``` diff --git a/slides/list.json b/slides/list.json index 4fde0d1..91d849e 100644 --- a/slides/list.json +++ b/slides/list.json @@ -1,9 +1,5 @@ [ "index.md", - [ - "about-me.md", - "emily.md" - ], [ "why-the-cli.md", "benefits.md", @@ -42,10 +38,10 @@ "escaping-shell-commands.md", "escapeshellcmd.md", "escaping-arguments.md", - "environment-variables.md", - "environment-variables2.md", "exit-codes.md", "exit-codes2.md", + "environment-variables.md", + "environment-variables2.md", "daemons.md" ], [ diff --git a/slides/php-cli-tools-example2.md b/slides/php-cli-tools-example2.md index 7521e5e..6186c12 100644 --- a/slides/php-cli-tools-example2.md +++ b/slides/php-cli-tools-example2.md @@ -4,14 +4,8 @@ $ php examples/PHPCliToolsExample.php ``` -```html -$ php examples/PHPCliToolsExample.php -How high should I count? [10]: 5 -Shall I shout it? [y/N]y -1! +
How high should I count? [10]: 5Shall I shout it? [y/N]y1!
 2!
 3!
 4!
-5!
-```
-
+5!
diff --git a/slides/php-sapi.md b/slides/php-sapi.md index 26fd113..6be76b0 100644 --- a/slides/php-sapi.md +++ b/slides/php-sapi.md @@ -9,4 +9,5 @@ if ('cli' !== php_sapi_name()) { Note: +* Used to running in something like the fpm-fcgi SAPI for web requests. * Use the php_sapi_name() function or PHP_SAPI constant to determine the server API being used diff --git a/slides/thank-you.md b/slides/thank-you.md index 3a80af4..5602390 100644 --- a/slides/thank-you.md +++ b/slides/thank-you.md @@ -1,7 +1,8 @@ ## Thank You! Steve Grunwell
-[stevegrunwell.com](https://stevegrunwell.com)
-[liquidweb.com](https://www.liquidweb.com) +Senior Software Engineer, Liquid Web -[stevegrunwell.com/slides/php-cli](https://stevegrunwell.com/slides/php-cli) + diff --git a/slides/wp-cli-example.md b/slides/wp-cli-example.md index b05848a..bc043bf 100644 --- a/slides/wp-cli-example.md +++ b/slides/wp-cli-example.md @@ -13,4 +13,6 @@ WP_CLI::add_command( 'example-command', 'Example_WP_CLI_Command' ); Note: -Looking at WP-CLI commands, they're registered using the WP_CLI::add_command() method. \ No newline at end of file +Looking at WP-CLI commands, they're registered using the WP_CLI::add_command() method. + +Each command class will contain at least one public method, each of which will become sub-commands (e.g. "wp example-command some-function"). diff --git a/templates/_index.html b/templates/_index.html index 23198af..a07331b 100644 --- a/templates/_index.html +++ b/templates/_index.html @@ -17,7 +17,7 @@ - +