formapro/pvm – PHP library for building workflows and business processes

formapro/pvm is a PHP library for building workflows and business processes.  This is a nice addition to alternatives that I’ve looked at in “Getting started with workflows in PHP“.  The library is brought to you by Forma Pro, the same guys who are behind the php-enqueue enterprise queuing solution in PHP.

Async PHP Requests & Reactive Responses with PHP-FPM

Async PHP Requests & Reactive Responses with PHP-FPM” is talk by Holger Woltersdorf, in which he shares the approaches he tried for implementing asynchronous requests in PHP, and how he arrived at hollodotme/fast-cgi-client, which is a PHP fast CGI client for sending requests (a)synchronously to PHP-FPM.

PHP Smart Analyzer

PHP Smart Analyzer (or PHPSA for short) is yet another item in a growing list of tools for PHP code static analysis.  It’s in an early alpha state, but looking at the list of goals, it’s quite promising.

If that’s up your valley, have a look also at PHPQA and PHPStan, which I wrote about earlier.

Using Vim as a PHP IDE

Jon Cairns wrote “Using Vim as a PHP IDE” blog post a good five years ago, but a lot of it still relevant and useful. It covers all the usual – syntax highlighting, syntax checking/linting, tags and auto-completion, coding style and mess detecting, unit testing and debugging. As many other similar guides, he links to a variety of plugins and provides configuration tips.

PHP : Moving from array to class

Moving from array to class” is yet another thought-provoking take on the difference between arrays and classes in the modern versions of PHP.  The benefits of moving from arrays to classes seem to be not only in the code readability and maintainability, but quite clearly in performance and resource utilization (CPU and memory in particular).

YANG – A Data Modeling Language for the Network Configuration Protocol (NETCONF)

In the spirit of validating everything against a schema (validating JSON, validating CSV), here is another option – YANG:

YANG is a data modeling language for the definition of data sent over the NETCONF network configuration protocol. The name is an acronym for “Yet Another Next Generation”. The YANG data modeling language was developed by the NETMOD working group in the Internet Engineering Task Force (IETF) and was published as RFC 6020 in October 2010. The data modeling language can be used to model both configuration data as well as state data of network elements. Furthermore, YANG can be used to define the format of event notifications emitted by network elements and it allows data modelers to define the signature of remote procedure calls that can be invoked on network elements via the NETCONF protocol. The language, being protocol independent, can then be converted into any encoding format, e.g. XML or JSON, that the network configuration protocol supports.

YANG is a modular language representing data structures in an XML tree format. The data modeling language comes with a number of built-in data types. Additional application specific data types can be derived from the built-in data types. More complex reusable data structures can be represented as groupings. YANG data models can use XPATH expressions to define constraints on the elements of a YANG data model.

Like many other standards, formats, and tools developed by very smart people, YANG can be used for much more than just networking configuration.  If you data and states fit into its model, give it a try.

Here are a few resources that you might find useful in the process:

WordPress Plugin : Image Processing Queue

As described in “Introducing WP Image Processing Queue – On‑the‑Fly Image Processing Done Right“, Image Processing Queue plugin tries to solve several issues with On-The-Fly Image Processing (OTFIP) in WordPress.  Some of the things that it improves are:

  • Response times for pages with non-yet generated thumbnails.
  • Server CPU spikes for pages which use a lot of images on sites with a lot of configured thumbnail sizes (49? really? WOW! I don’t think I’ve seen more than 10 in the wild, which is still a lot).
  • Server disk space issues caused by removed images and leftover thumbnails.

This is a very useful direction and I hope all the necessary bits will make it into the WordPress core.  But even for those who don’t use WordPress, the whole discussion and implementation are a handy reference.

PHPUnit Snapshot Assertions – a way to test without writing actual test cases

phpunit-snapshot-assertions – is an interesting addition to the PHPUnit assertions which allows testing against previously created snapshots.  This is particularly useful for testing the outputs of API end-points, format conversion functions, and the like.  Instead of testing the actual functionality, these assertions allow to compare the output of the current test run with the known good output of a previously created snapshot.

This works well for generic text, but even better for widely used formats like JSON and XML, where, in case of a failed assertion, a meaningful difference can be provided.

Here is a blog post providing some more details on philosophy and methodology.