(Ab)using process control for powerful CLI applications

Ian Littman (14.Sep.2018 at 11:30, 50 min)
Talk at Cascadia PHP (English - US)

Rating: 4 of 5

PHP's process control (pcntl) extension provides a set of highly underrated tools for scripts invoked at the command line, exposing behaviors that you might have thought only existed for compiled applications, such as forking and signal handling. We'll dive into these behaviors, including fun diversions like making a process zombie that rises from the dead when you hit Ctrl-C, and a parallel utility that uses multiple processes to get things done faster. We'll also take a look at Symfony's Process component that can be used to execute additional command lines safely and asynchronously, whether you need to run those commands from a web cotext or a CLI.

Who are you?

Claim talk

Talk claims have been moved to the new Joind.in site.

Please login to the new site to claim your talk

Want to comment on this talk? Log in or create a new account or comment anonymously

Write a comment

 
Please note: you are not logged in and will be posting anonymously!
= six minus zero

Comments

Rating: 4 of 5

14.Sep.2018 at 12:29 by Steve Grunwell (128 comments) via Web2 LIVE

Thanks for making me realize how little I know about the PHP CLI, Ian!

Full of great information and ideas, but could benefit from a high-level look at processes, threads, signals, etc. at the top of the talk to help set some base terms.

Rating: 5 of 5

14.Sep.2018 at 16:16 by Patrick Schwisow (136 comments) via Web2 LIVE

Lots of great info. Glad you shared all the example code.

Rating: 4 of 5

15.Sep.2018 at 12:07 by Jessica Mauerhan (44 comments) via Web2 LIVE

This was really interesting, and covered a lot of stuff that was completely new to me. I could definitely have benefited from a little more intro to certain terms at the beginning.

I have used the Symfony Process component a lot so I was excited to see that bit covered, it's such a great library to make this sort of work easier. I'm going to have to check out some of the other tools Ian covered.

© Joind.in 2018