Cees-Jan

Cancelling ReactPHP fibers

A feature that we really needed to make our fiber integration complete is the cancellation of them. Or to be more precise, the cancellation any awaited promise yielding operations in that fiber and as a consequence the fiber that those are awaited in. This post goes into detail how different cancelation scenarios work for the PR introducing it, and was originally part of that PR's documentation but was replaced by a simpler section.

Cancelled PHP 8.1 fibers (green threads)

Photo by Jeffrey Czum from Pexels


Read on →

Categories: PHP - ReactPHP Tags: 8.1 - Fibers - PHP - Async - Await

Cees-Jan

Thoughts on psr/log versions

One of the things that came up while upgrading packages is PSR-3's new v2 and v3 releases. They add type hints to methods and return type hints. For packages implementing this means that they can't support all 3 versions. For packages only consuming psr/log all 3 versions can be used as you don't have to build classes on them.

However, for packages implementing PSR-3 this suddenly became more complex. All of a sudden you need 3 major versions if you want to support all PSR-3 versions. For a package that only implements PSR-3 this isn't so much of an issue, but when the implementation is embedded inside another package you all of a sudden reach dependency hell. And one thing I learned while upgrading my packages is how deep our dependency on psr/log goes these days.

The mistake I've made with at least one PR in the past few weeks is miss that a consumer of psr/log is also an implementer, and I missed that. So now I get to get back and make a new PR resolving that mess I introduced.


Read on →

Categories: PHP - PSR-3 - Short Tags: logging

Cees-Jan

The DigitalOcean challenge: Implementing Kyverno

DigitalOcean put a challenge out at the end of this year to improve your knowledge of Kubernetes. And while it's been nearly two years I created my first cluster with them, (It's still my main public cluster.), there is always more to learn. So in this post we're going to take a look at Kyverno for policy enforcement.

PHP 8.1 fibers (green threads)

Photo by Erik Mclean from Pexels


Read on →

Categories: Kubernetes - DigitalOcean - Kyverno Tags: YAML - security - policy