Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sergey Zhuk:
Building ReactPHP Memached Client: Emitting Events
Nov 03, 2017 @ 09:44:39

Sergey Zhuk has posted the third part of his series covering the creation of a Memcached client using ReactPHP has the base and allowing for asynchronous operations. In this latest part of the series (part three) he focuses on emitting events for various actions/results in the client code.

In the previous article, we have faced with a problem: how to deal with a broken connection. Now, when the connection is closed all pending requests are rejected with the ConnectionClosedException. If we want to handle this situation we need to attach onRejected handlers to all promises because we can’t guess in advance which one will be the problem.

This [example] code already looks too complex, but also there is no way to find out if the connection was broken or we have manually close it. So, it becomes clear that we need a completely different approach.

He then shows how to make use of this event library to emit events at certain points in the client's state. He includes code examples showing how to use the emit method to throw the event focusing on handling when there's connection issues.

tagged: reactphp memcached client async emit event connection handling series part3

Link: http://sergeyzhuk.me/2017/11/03/memcached-reactphp-p3/

Herberto Graca:
Event-Driven Architecture
Oct 10, 2017 @ 10:28:19

In this new post to his site Herberto Graca has posted the latest part of his "The Software Architecture Chronicles* series, focusing this time on event-driven architectures.

This post is part of The Software Architecture Chronicles, a series of posts about Software Architecture. In them, I write about what I’ve learned on Software Architecture, how I think of it, and how I use that knowledge. The contents of this post might make more sense if you read the previous posts in this series.

Using events to design applications is a practice that seems to be around since the late 1980s. We can use events anywhere in the frontend or backend. When a button is pressed, when some data changes or some backend action is performed.

But what is it exactly? When should we use it and how? What are the downsides?

He starts by talking about the "what", "when" and "why" of using events to drive the architecture of the system, going into each of the topics in a bit more depth:

  • To decouple components
  • To perform async tasks
  • To keep track of state changes (audit log)

He then goes on to talk about common patterns for event-driven applications including event notification, event-carried state transfer and event sourcing.

tagged: event architecture software decouple async state notification sourcing

Link: https://herbertograca.com/2017/10/05/event-driven-architecture/

Freek Van der Herten:
Handling Stripe webhooks in a Laravel application
Oct 09, 2017 @ 10:33:06

Freek Van der Herten has a new post to his site showing you how to handle Stripe callbacks when integrating its webhook functionality into your application. True to form, he also created a Laravel package to make it even easier.

In the project I’m currently working on I had to integrate Stripe webhooks. Stripe has great documentation on how to handle webhooks, but it still took a fair amount of time to get the integration just right. My solution for handling webhooks is pretty generic and reusable by others. I decided to extract it to a package called laravel-stripe-webhooks, so nobody has to code this stuff up again. In this blogpost I’d like to share how the package works.

He then goes on to talk about the request validation that happens on the webhook callback and how the information can be reworked if something goes wrong. He then talks about the handling of valid requests either using a custom job or using events to trigger when a "source.chargable" event is fired.

tagged: stripe laravel package webhook tutorial event job

Link: https://murze.be/2017/10/handling-stripe-webhooks-laravel-application/

Nexmo Blog:
Laracon 2017 New York City – Conference report
Aug 23, 2017 @ 10:47:32

If you weren't able to make it to this year's Laracon US conference, the Nexmo blog has shared a summary of the event including some of their own highlights.

I recently attended Laracon in New York City for the 4th year in a row. This year the conference was held at New World Stages in Hell’s Kitchen, with 500 people in attendance (and a waiting list of over 1000!) making it the biggest one yet.

While the conference focuses on the Laravel PHP framework, the talks were diverse and covered topics like database segregation for multi-tenant applications, aesthetic and design tips for developers, advice on growing and scaling a side project into a business, and the importance of deep-focus work.

The author focuses on four of the talks that she found most useful:

  • "CRUDDY by Design" from Adam Wathan
  • "Custom Laravel" by Matt Stauffer
  • "Slay the Beast" from Jeffrey Way

The final talk was actually a keynote from Taylor Otwell himself covering the major changes that are coming in the 5.5 version of the framework including the Laravel Horizon queue management package. Each section comes with details of the session and links to other sources for more information.

tagged: laraconus17 conference wrapup summary event community laravel

Link: https://www.nexmo.com/blog/2017/08/15/laracon-2017-nyc-conference-report-dr/

PHP Roundtable:
065: TestFest 2017
Aug 01, 2017 @ 12:19:09

The PHP Roundtable podcast, hosted by PHP community member Sammy Powers, has posted their latest episode - Episode 065: TestFest 2017 with guests Ben Ramsey, Rafael Dohms, Zoe Slattery and Cal Evans.

Adding tests to php-src is a great way to get involved with PHP internals. Don't know how to get started? You're in luck. TestFest 2017 is going to be a thing in September. User groups and individuals around the world are going to organize to learn how to add tests to PHP and become official internals contributors.

It has been 7 years since the last TestFest in 2010. We chat about how to get involved with TestFest 2017.

You can catch this latest episode either using the in-page audio or video player or by watching it directly on YouTube. If you enjoy the episode consider subscribing to their feed and following them on Twitter to get the latest updates when new shows are released.

tagged: phproundtable podcast ep65 testfest2017 testing event core language

Link: https://www.phproundtable.com/episode/php-test-fest-2017

Sound of Symfony Podcast:
Episode 18 - Event sourcing
Jul 25, 2017 @ 12:51:49

The Sound of Symfony podcast, with hosts Magnus Nordlander and Tobias Nyholm, recently posted their latest episode - Episode #18: Event Sourcing.

In this episode we talk a little bit about Webpack Encore, and a lot about Event Sourcing, with our guest, Beau Simensen.

Other topics mentioned in this show include:

  • Beau's Domain-driven design book
  • Event sourcing libraries like EventCentric, Broadway and Prooph
  • Conferences like SymfonyLive and SymfonyCon Romania

You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. If you enjoy the show you can subscribe to their feed and follow them on Twitter to get updates when new shows are released.

tagged: soundofsymfony podcast ep18 eventsourcing event beausimensen

Link: http://www.soundofsymfony.com/episode/episode-18/

Tomáš Votruba:
The Bulletproof Event Naming For Symfony Event Dispatcher
Jul 21, 2017 @ 12:39:28

In a recent post to his site Tomáš Votruba shares what he sees as a "bulletproof" event naming scheme for use with the Symfony event dispatcher component.

I wrote intro to SymfonyEventDispatcher and how to use it with simple event.

But when it comes to dispatching events, you can choose from 4 different ways. Which one to choose and why? Today I will show you pros and cons of them to make it easier for you.

He then breaks up the remainder of the post into the four suggestions, each with code examples and brief descriptions:

    1. Start with Stringly
    1. Group File with Events Names as Constants
    1. ...Constant Names in Particular Event Classes
    1. Class-based Event Naming

For each he also includes some "pros" and "cons" to help you select which one might work best for your usage. He ends by taking things "a step further" and sharing integrating a suggestion to remove an argument and simplify the code.

tagged: naming symfony event dispatcher event tutorial

Link: https://pehapkari.cz/blog/2017/07/12/the-bulletproof-event-naming-for-symfony-event-dispatcher/

Tomáš Votruba:
The Bulletproof Event Naming For Symfony Event Dispatcher
Jul 21, 2017 @ 12:39:28

In a recent post to his site Tomáš Votruba shares what he sees as a "bulletproof" event naming scheme for use with the Symfony event dispatcher component.

I wrote intro to SymfonyEventDispatcher and how to use it with simple event.

But when it comes to dispatching events, you can choose from 4 different ways. Which one to choose and why? Today I will show you pros and cons of them to make it easier for you.

He then breaks up the remainder of the post into the four suggestions, each with code examples and brief descriptions:

    1. Start with Stringly
    1. Group File with Events Names as Constants
    1. ...Constant Names in Particular Event Classes
    1. Class-based Event Naming

For each he also includes some "pros" and "cons" to help you select which one might work best for your usage. He ends by taking things "a step further" and sharing integrating a suggestion to remove an argument and simplify the code.

tagged: naming symfony event dispatcher event tutorial

Link: https://pehapkari.cz/blog/2017/07/12/the-bulletproof-event-naming-for-symfony-event-dispatcher/

Ben Ramsey:
Announcing Testfest 2017
Jul 17, 2017 @ 11:14:53

In a new post to his site long time PHP community member Ben Ramsey has officially announced PHP Testfest 2017, an event that gathers developers to write tests for the PHP language itself to help improve its quality and show them how to contribute back to the project.

For those who’ve been around the PHP community for a while, you’ll recall the successful PHP TestFest events that began after a discussion at PHP Quebec in 2008. Many user groups and mentors signed on to host and help with events, and a lot of folks became first-time contributors to the PHP project, helping improve our code coverage. It ran strong in a global sense from 2008 to 2010. After that, various groups (particularly the Brazilian groups) have continued the tradition.

A few months ago, at php[tek] in Atlanta, I mentioned to Michelangelo that I’d love to bring back PHP TestFest. Sammy had given an excellent talk on writing PHPT tests, and <a href="https://twitter.com/ellotheth/status/868583446498734084>Gemma tweeted a link to the old PHP TestFest wiki page. From there, things snowballed.

Ben the provides the details of the planned Testfest that will run for four months and can be worked on from anywhere, not just one single event. The plan is to have it run from September through December of 2017 and there's plenty of support to help out. Organizers can email for more help getting started. There's also a website, Google Group and IRC channel as well as tools and resources to help bring you up to speed on testing the PHP language with phpt tests.

tagged: testfest17 testing language phpt event quality testfest community

Link: https://benramsey.com/blog/2017/07/phptestfest/

Sam Greenwood:
Event Sourcing for the Rest of Us
Jun 27, 2017 @ 12:15:20

In this recent post to his site Sam Greenwood gives a high level overview of functionality that's becoming more popular and widely used - event sourcing. His post is a guide to event sourcing "for the rest of us" that aren't familiar with it but want to get an understanding of what it's all about.

Event sourcing can be described as storing the events that happened in your system in the order they happened, in some kind of store. These events are then replayed to recreate state in your system, rather than just having a single row in a table, using event sourcing, you have a full history of actions that happened in your system, and how your state got to the given point that it is in.

He uses a single entity in his illustration, showing how the changes would be put into an EventStore repository (possibly stored in something like this). He then sets up his event system for "members" and shows how to apply the different associated events. This is then sent to the repository for handling and saving to whatever data source you have defined.

tagged: eventsourcing introduction tutorial member event example

Link: https://www.samgreenwood.me/event-sourcing-for-the-rest-of-us/