building-for-php-cli
building-for-php-cli copied to clipboard
Slides for "Building for the PHP Command Line Interface"
Building for the PHP Command Line Interface
Executing PHP from the command line enables us to interact with our applications in new and interesting ways: from performing site maintenance to scaffolding new projects, CLI tools like WP-CLI, Artisan, and Drush make it easy to interface with our code without ever opening a browser.
Attendees will be introduced to popular PHP CLI tools and their default capabilities. We'll discuss characteristics of good CLI scripts, strong use-cases for writing custom commands, then write several CLI programs across different platforms.
:sparkles: View slides :sparkles:
This presentation also has a companion repository, full of executable examples from this presentation.
Demonstrated Tools
Platform-specific CLI tools
Additional Resources
- Building PHP Daemons and Long Running Processes - Talk from php[tek] 2015 by Tim Lytle
- Writing WP-CLI Commands That Work! - Sister talk focused on writing WP-CLI commands
- What are Exit Codes in Linux? - Explanation of standard exit codes and their meanings
- Understanding Exit Codes and How to Use Them in Bash Scripts - Article by Benjamin Cane
- Flysystem - Popular package for filesystem operations across environments
-
Cropping and Resizing Animated Gifs with Gifsicle - Blog post explaining how to create animated thumbnails for gifs, which relies on calling Gifsicle via
passthru()
Presentation History
- php[tek] 2024 — April 24, 2024 (Joind.in, PDF)
- Midwest PHP 2019 — March 8, 2019 (Joind.in, PDF)
- WavePHP 2018 — September 20, 2018 (Joind.in, PDF)
- Southeast PHP - August 17, 2018 (Joind.in, PDF)
- PHPDetroit - July 28, 2018 (Joind.in, PDF)
- php[tek] 2018 - May 31, 2018 (Joind.in, PDF)
- Music City Code 2017 - June 3, 2017
- CodeMash 2017 - January 13, 2017
- Nomad PHP (EU) – December 15, 2016 (Joind.in)
- php[tek] 2016 – May 27, 2016 (Joind.in)
- Columbus PHP Meetup – April 13, 2016 (Joind.in)