Building for the PHP Command Line Interface

By Steve Grunwell

Elevator Pitch

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.

Description

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.

Notes

An overview of running PHP on the CLI, including tools available for popular frameworks + platforms.

Slides are available at https://stevegrunwell.com/slides/php-cli, with code samples at https://github.com/stevegrunwell/php-cli-examples.