I'm blogging about Emacs, Drupal, php and exciting subjects

Writing Drupal Tests with PHPUnit: Unit, Kernel, and Functional Tests

Drupal's testing infrastructure is built on PHPUnit, but it layers three distinct test types on top of it — each with different bootstrapping, speed, and fidelity trade-offs. Most Drupal developers have run tests but haven't written them deliberately. This guide covers what each test type is actually good for, how to set up a working test environment, and real module test examples that demonstrate the patterns you'll use daily.

Tree-sitter in Emacs 29+: Setting Up Syntax Highlighting for PHP and Web Languages

Tree-sitter is a parser generator and incremental parsing library that gives text editors access to a concrete syntax tree of the code being edited. Emacs 29 shipped with built-in tree-sitter support, and Emacs 30 continues to expand it. For PHP developers, tree-sitter means faster, more accurate syntax highlighting, structural navigation, and the foundation for features like combobulate and future indentation improvements.

Cumulative Layout Shift (CLS) Fixes: Fonts, Images, and Dynamic Content

Cumulative Layout Shift measures visual instability — how much the page content moves around while loading. Google uses it as a Core Web Vital, and a poor CLS score (above 0.25) directly affects rankings. The target is 0.1 or below at the 75th percentile. This article goes through every major cause with production-ready code fixes, covering images, web fonts, dynamic content, ads, and Drupal-specific patterns.

Emacs from Scratch: A Modern init.el with use-package and straight.el

Pre-built Emacs configurations like Doom Emacs and Spacemacs are impressive. They give you a working, polished setup in minutes. But they are also someone else's opinion about how Emacs should work, and when something breaks — or when you want to understand what is actually happening — you are left reading hundreds of files written by strangers.

Xdebug 3 Setup with Docker, Nginx, and PhpStorm or Emacs

Getting Xdebug 3 working through a Docker/Nginx stack is the kind of task that takes an afternoon if you don't know the networking pitfalls. This guide cuts straight to a working configuration, explains every setting, and covers both PhpStorm and Emacs (DAP Mode) as IDE targets.

Drupal Entity API: Creating a Custom Content Entity in Drupal 11

The Drupal Entity API is the backbone of every non-trivial Drupal project. Nodes, users, taxonomy terms, and media items are all content entities. When you need structured data that does not map neatly to a Node — say, a service ticket, a product, an event log entry — you build a custom content entity. In Drupal 11 with PHP attributes replacing annotations, the developer experience is cleaner and more IDE-friendly than ever.

Drupal Security Hardening Checklist for Production Sites

Drupal has an excellent security track record at the core level, but production breaches consistently come from misconfigurations, outdated contributed modules, overly permissive file system settings, and missing server-level controls. This checklist covers every layer: Drupal application, file system, database, Nginx/PHP-FPM, and monitoring. Apply these in order; each section builds on the last.

Nginx HTTP/2 and HTTP/3 (QUIC): Configuration Guide for 2026

HTTP/2 has been the default for production Nginx deployments for years. HTTP/3, built on QUIC, is now a first-class Nginx feature as of version 1.25.0 — available in the official Nginx mainline and stable packages without custom builds. This guide covers enabling both protocols correctly, including TLS requirements, firewall rules, verification, and the gotchas that catch people out.

PHP 8.4 Asymmetric Visibility: Public Read, Private Write Properties

PHP 8.4, released November 21 2024, ships a feature that immediately earns its keep in any domain-model-heavy codebase: asymmetric property visibility. You can now declare a property's read scope and write scope independently, in a single declaration — no boilerplate getters, no magic __set guards, no readonly trade-offs.

This article covers the full syntax, every valid modifier combination, the interaction with readonly and property hooks, and a set of patterns drawn from real Drupal and PHP application code.

Subscribe to