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

Symfony Blog:
Symfony website updates #3 - Events
Jul 23, 2018 @ 11:26:38

On the Symfony blog they've posted about an additional update they've made to bring more information to the community: an Events section.

Following the new features we've added in May in the Events & Meetups section, we're pleased to introduce a brand new section within the main website menu: Symfony Events. This will enable you to find a Symfony event near you more easily.

[...] The Events section itself has also been improved, again! We've added a map where you can see at a glance where are organized all the upcoming Symfony events. You can find on the map: all the upcoming official Symfony conferences pinned in red and all the upcoming Symfony community events pinned in blue.

They also added a feature that will automatically pull in Symfony events from the Meetup.com site so there's no need to list them in both places.

tagged: symfony community blog enhancement website events list map

Link: https://symfony.com/blog/symfony-website-updates-3

Laravel News:
Upcoming Laravel Events and Meet-ups happening in July
Jul 09, 2018 @ 09:55:46

On the Laravel News site they have a new post sharing some of the Laravel-related events happening in July (2018).

Looking to meet other Laravel developers? Want to improve your skills as a developer? Consider attending a meetup or a conference in your area.

They have four events listed for this month:

Dates and links to each are provided in the post including a link to the Laravel Events calendar.

tagged: laravel events july2018 meetup conference

Link: https://laravel-news.com/events-july-2018

That Podcast:
Episode 49: The One Where the Events Are the Sauce and Not the Meat
Mar 20, 2018 @ 12:55:50

That Podcast, hosted by PHP community members Beau Simensen and Dave Marshall, has posted their latest episode - Episode #49: The One Where the Events Are the Sauce and Not the Meat.

Beau and Dave discuss EventSauce (eventsauce.io) with Frank de Jonge.

In the episode they talk with Frank some of his previous work on the Flysystem library and, more recently, on EventSauce. Other topics include other event-driven packages such as Prooph and Broadway as well as the Hardcore History series by Dan Carlin. You can listen to this latest episode either using the in-page audio player or by downloading the mp3. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter for updates on when new shows are released.

tagged: thatpodcast ep49 events eventsauce frankdejonge guest

Link: https://thatpodcast.io/episodes/episode-49-the-one-where-the-events-are-the-sauce-and-not-the-meat

SitePoint PHP Blog:
Extending OctoberCMS – Building a Soft-Delete Plugin
Nov 07, 2016 @ 10:38:24

The SitePoint PHP blog has a new post today helping the users of the OctoberCMS content management system build a "soft delete" plugin by extending the functionality already included in the code.

Developers usually stick with a new CMS for its simplicity and extensibility. OctoberCMS presents itself as a back to basics CMS, and provides an enjoyable experience for both developers and users. In this article, I’m going to demonstrate some aspects of the CMS that make it extensible, and we’ll also try a simple plugin to extend another plugin functionality.

The tutorial starts by talking about extensibility and how plugins play into it in most normal CMS software (in their example, its listening to an event fired when a new post is made). They start by creating a new plugin skeleton via the "create:plugin" artisan command and creating a migration to extend the database with the "soft delete" column. After running the migration, they add in a new listener for an "extendColumns" event and extending the filter to extend the scopes pulling out posts data. They further extend the functionality with a helpful trait filtering the data by the "deleted_at" value and adding that into the scope as well. Finally they add a listener onto the Eloquent events for the "deleting" event to capture it and set the "deleted_at" value on the post record and save it.

tagged: extend octombercms contentmanagement tutorial softdelete delete plugin events

Link: https://www.sitepoint.com/extending-octobercms-building-a-soft-delete-plugin/

ThisData Blog:
Subscribing to Symfony's Security Events
Nov 01, 2016 @ 12:27:22

In this recent post to the ThisData blog Nick Malcolm shows you a method for subscribing to the events that the Symfony framework throws during the course of its execution with simple listeners.

Symfony is a popular web framework for PHP apps, and comes with a powerful event notification system which fires events when almost anything happens inside the system. Hooking in to these events can add advanced functionality to your app.

The most common way to listen to an event is to register either an event "listener", or an event "subscriber". We're going to use Subscribers. In this post we'll create a Subscriber which listens for successful and unsuccessful Log In events, and responds by sending information to ThisData.

He starts with a Symfony demo application and show the creation of a basic subscriber to specifically listen to the security events. In this case they're only looking for authentication failures and interactive logins. He walks through what the subscriber code is doing step-by-step and includes the registration of the subscriber. This includes an update to send the event results over to the ThisData service for easier ingestion and reporting. This final step isn't a requirement to get the subscriber working, it's just an optional step they've provided as one method to handle the eventing output.

tagged: security events thisdata symfony subscriber tutorial

Link: https://thisdata.com/blog/subscribing-to-symfonys-security-events/

Laravel News:
Laravel 5.3 changes the “app” folder
Jul 22, 2016 @ 09:25:24

On the Laravel News site there's a new article posted about a big change coming to the "app" folder in Laravel-based applications (hint: it's moving towards more simple, not more complex).

As we are getting closer to the launch of Laravel 5.3 new features, seem to come out almost daily. The latest is a change to the “App” folder and in a move to simplify it, the Events, Jobs, Listeners, and Policies folders are now gone.

You can still get them back if you "artisan make" something that fits in one of these four folders but, as they're not really "required" by default they were removed to do some de-cluttering. If you want to find out more about what else is coming/changing in Laravel 5.3, check out this other article also on the Laravel News site.

tagged: laravel changes application app folder events jobs listeners policies

Link: https://laravel-news.com/2016/07/laravel-5-3-changes-app-folder

Freek Lijten:
Separating concerns even better with events
Mar 09, 2015 @ 09:17:26

Freek Lijten has a new post to his site today today talking about a concept of good OOP design, separation of concerns, and how the use of events can help make it "even better". In it he converts some code from a decently structure state into something even driven, splitting out the work from the handling code.

At PHP Benelux 2015 I witnessed a talk by Matias Noback about events. It was a great talk so if you have chance to see it yourself somewhere, do so! In a very tiny nutshell he took us from what most would consider already decent code to better code. Lets start with "decent".

His "decent" code handles user management, executing certain business rules once the user is successfully registered. In the first version of is code, the User is passed into the "saveUser" function and several actions are performed (is the username in use? can they be saved?) including the sending of the email as requested once a user registers. This code is primarily procedural, all in one place and Freek updates it using events to make it a bit more well-contained. He extracts the piece sending the email and translates that into an event. This is then pushed into a set of handlers and executed allowing for greater flexibility if additional actions are needed in the future.

tagged: seperation concerns events tutorial introduction

Link: http://www.freeklijten.nl/home/2015/03/09/Separating-concerns-even-better-with-events

Mathias Noback:
Some questions about the command bus
Jan 12, 2015 @ 09:46:46

Mathias Noback has continued his series looking at the use of command busses in PHP applications. In this third part of his series, he answers some questions that have been asked by his own readers.

So far we've had three posts in this series about commands, events and their corresponding buses and handlers: a wave of command buses, responsibilities of the command bus, from commands to events. Now I'd like to take the time to answer some of the very interesting questions that by readers.

He answers questions about:

  • The difference between commands and events
  • Disadvantages of using a command bus
  • The command as constructor argument
  • How to return a value from the command bus
  • Could commands handle themselves?

Each question comes with a portion of the question from the original author, an explanation and some code where needed to illustrate his point.

tagged: commandbus question answer reader events disadvantages return handling

Link: http://php-and-symfony.matthiasnoback.nl/2015/01/some-questions-about-the-command-bus/

Matthias Noback:
From commands to events
Jan 09, 2015 @ 10:43:09

Matthias Noback is back with another post in a series looking at using a command bus to execute more complex code in somewhat of an isolation from the rest of the application. In this new post he moves on to some of the secondary tasks that happen inside the commands and how those relate to event handling.

In the previous posts we looked at commands and the command bus. Commands are simple objects which express a user's intention to change something. Internally, the command object is handed over to the command bus, which performs the change that has been requested. While it eventually delegates this task to a dedicated command handler, it also takes care of several other things, like wrapping the command execution in a database transaction and protecting the original order of commands.

He gets into some of these secondary tasks inside of the commands themselves - smaller actions that need to be done as a part of the execution of the command as a whole. He points out that it's tempting to do everything inside the command, but that it can lead to maintenance issues down the line. He suggests that the command shouldn't perform these tasks at all. They should be handled by an event system that uses event objects to pass off responsibility for performing actions to other objects (for example, handling the post-signup process once a user is created). He's done some research on some event dispatchers currently available but found them lacking in one way or another. Instead he opted to integrate one into his SimpleBus library (EventBus) to provide an integrated way of handling these secondary events. An example of it in use is also included.

tagged: commands events commandbus simplebus secondary task dispatch

Link: http://php-and-symfony.matthiasnoback.nl/2015/01/from-commands-to-events/

Michael Dowling:
Guzzle 5 and RingPHP
Oct 14, 2014 @ 10:52:25

Michael Dowling has a new post to his site today talking about the latest release for the Guzzle HTTP library and how it now works with RingPHP to make integration life easier. The RingPHP library, inspired by Clojure's Ring library, provides a low-level structure to work with HTTP clients and servers through a simple interface.

With RingPHP, Guzzle does not require cURL and can be used with any HTTP transport mechanism. I’d love to help anyone who is interested in creating RingPHP adapters to bind Guzzle to another library. For example, WyriHaximus on Github is working on binding Guzzle to ReactPHP. (In fact, Guzzle 4 did not require cURL, though it was much harder to use an alternate transport.)

He goes on to talk more about the changes in the Guzzle 5 release including more detail on the RingPHP integration, the use of promises/futures and iterable and callable streams. There's also several new events included in the release as well. He finishes out the post with an upgrade guide to help make the transition easier.

tagged: ringphp guzzle5 release http promise future psr7 streams events

Link: http://mtdowling.com/blog/2014/10/13/guzzle-5/