As expected, ZendCon was a blast and a great kick off to our fall tour of PHP conferences. It’s always fun to spend time with the PHP community, and show off our new elephant swag!
Talks and Tutorials
I had the opportunity to give both a talk and tutorial this year. While PHP is known for serving web requests, and most PHP code operates in that context, the tutorial covered the less common uses of long running processes and daemons.
It’s a pretty simple concept: loop until the job is done. Or in the case of a daemon, loop until a stop signal is received. Since
while(true) is a bit light in terms of content, we explored some example uses cases. Consuming the Twitter streaming API was both a natural place to start and always a fun demo to show.
For long running processes, we took a look at normalizing large sets of data. We used Nexmo’s Number Insight API to take 10,000 rows of phone numbers and country codes and add columns for the internationalized version of the number and the number in a proper localized format.
Looking at Daemons, we put together a simple system that accepts wake up call requests, queues those requests, and a daemon processes the queue and uses Nexmo’s API to make the call.
Even if you weren’t able to make the tutorial, you can take a look at the example code and see the progression.
2FA and PHP
I also had a chance to talk about the various methods of second factor authentication. Useful for protecting login, or really any significant action, second factor authentication can be implemented in a variety of ways. From physical hardware, to mobile apps, to single use codes delivered by SMS or over the phone, each has a different impact on your user and your code.
We also took a look at a simple PHP application, to see how adding second factor authentication changes the code. Take a peek at the repository for a walk through on that process. With all the different options for second (or really multi) factor authentication, it’s important to remember that you don’t have to just pick a single method. Another branch adds Google Authenticator support in addition to the Nexmo powered 2FA.
If you were at either of these sessions, I would love your feedback on joind.in:
ZendCon was just the first stop on our fall PHP tour. Last week we hit Scotland PHP, and next week we’ll be at php[world]. And yes, we’ll have more Nexmo ❤️ Elephants shirts. If you’re there, make sure to stop by and say ‘Hi’.