PSR-18: Abstracting HTTP clients in PHP

20.5.2022

Conference: PHPDay Italy 2022, Verona
Title: PSR-18: Abstracting HTTP clients in PHP
Links: slides

PSR-18 defines how to send PSR-7 requests without binding your code to a specific client implementation. Major HTTP clients like Guzzle and the Symfony HTTP client support PSR-18. This is particularly interesting for reusable libraries that need to send HTTP requests but don't care about specific client implementations.


TLDR: Summary by Matthias Pigulla (@mpdude_de)

php conference architecture libraries web client


Symfony routing under the hood

24.2.2022

Conference: Confoo Montreal 2022, Virtual
Title: Symfony routing under the hood
Links: slides

Routing is this thing about mapping URLs to controllers, right? But in fact, there is a lot going on. Understanding the routing process will enable you to write more flexible code and keep logic out of your controllers. In this talk, we will see how the Symfony routing actually works and then look at extension points like ParamConverters, custom request listeners and have a look at extending the route matching process.

php conference routing


Using Symfony components standalone in any project

23.2.2022

Conference: Confoo Montreal 2022, Virtual
Title: Using Symfony components standalone in any project
Links: slides

Symfony is not only a full stack framework, but also a collection of components that you can use stand alone in your projects to solve specific tasks. I will explain the ideas of the components and basic concepts, then look more specifically at the console component.

php conference architecture libraries symfony


Debugging PHP Applications at Web Summer Camp 2021

21.9.2021

Conference: Web Summer Camp Croatia 2021, Sibenik
Title: Fixing PHP Applications

Sooner or later, any application will run into errors. Some of them will be your fault, or that of a teammate. Others stem from third party libraries you are using. Even if your code would be perfect, other systems you rely on will sometimes fail. In this workshop, we look at how you can prevent errors, mitigate the impact of errors and track what is going on in your application. We do a bunch of hands-on exercises with various debugging strategies that help to locate the cause for an error quickly.

Read more

php architecture https web server


How I host multiple websites on Linode with HAProxy

7.4.2021

This website and a couple others all run on a single small Linode virtual server. Most sites are generated with the static site generator Sculpin, but some require PHP and other technologies.

I wanted to keep the server relatively clean and be able to test my setup locally. Therefore i created a couple of docker containers and use docker-compose to run the whole system. All pages are served over https, using letsencrypt to get free SSL certificates. In this post I want to share about the tools I use.

Read more

php architecture https web server


Integrating rokka.io with the Sculpin Static Site Generator

6.4.2021

Sculpin is a generator for static HTML websites. You write your content in Markdown, Twig Templates or HTML and Sculpin generates the whole page from it. An all-static HTML website is very easy to host, as you only need something to deliver static files like an AWS S3 bucket.

rokka.io is an image CDN that scales and optimizes images for the web. We recently released an update to the Rokka Symfony Bundle that adds support to upload images from Twig templates. As Sculpin is based on Symfony, Bundles can be loaded and configured like with a normal Symfony application.

In this blog post, I will show some examples of how the two can be used to build a static website with images scaled and delivered by rokka.io.

Read more

php architecture rokka web


Symfony World: Decoupling an Application with Symfony Messenger

3.12.2020

Conference: Symfony World 2020, Online
Title: Decoupling an Application with Symfony Messenger

Quick response times are crucial. Time consuming tasks triggered in web requests should be executed asynchronously, if at all possible. In this talk I will give a short overview of what message queues are and then show a case study how we split up an application into smaller services and how we use message queues to coordinate the services.

Read more

php message queues symfony rabbitmq conference


Doctrine and Generated Columns

26.2.2019

Using a smart SQL query with subqueries, we reduced the time to build a data export by a factor of (at least) 50. On the development system with little data, we got from the response from 11 seconds to about 0.25 seconds.



To make this possible, we had to use a generated column to be able to create an index on a field inside a JSON column. Doctrine does not know Generated Columns, so we had to hide the column and index from the Doctrine Schema Generator.

Read more

php performance mysql doctrine


PSR-18: Abstracting HTTP clients in PHP

26.1.2019
Conference: PHP Benelux 2019, Antwerp, Belgium
Title: PSR-18: Abstracting HTTP clients in PHP
Links: slides, demo

PSR-18 defines how to send PSR-7 requests without binding your code to a specific client implementation. This is particularly interesting for reusable libraries that need to send HTTP requests but don’t care about specific client implementations.

http php conference


Going crazy with Varnish: Caching pages of logged in users

6.12.2018
Conference: Symfony Con 2018, Lisbon, Portugal
Title: Going crazy with Varnish: Caching pages of logged in users
Links: slides

You know how HTTP caching works but need more? In this talk we look into ways to cache personalized content. We will look at Edge Side Includes (ESI) to tailor caching rules of fragments, and at the user context concept to differentiate caches not by individual user but by permission groups. A big help to leverage this concept is the FOSHttpCache in combination with either Varnish or the Symfony HttpCache reverse proxy.

varnish caching conference