Useful Health Check Endpoints in PHP Applications

At PMG we run pretty much every application in AWS's Elastic Container Service with web entrypoint handled by Application Loader Balancers. One feature of the ALB and ECS is that web-based services do a blue/green deployment. When a new version of the application is shipped, it spins up a new container in the ECS cluster… Continue reading Useful Health Check Endpoints in PHP Applications

Symfony Logout Handlers vs Logout Success Handlers

Symfony's security configuration for logout functionality in a firewall has a few handler keys that are worth digging into: Logout Handlers These are defined in the handlers key of the configuration above and the classes behind the listed services must implement LogoutHandlerInterface. Logout handlers should perform actions related to logging the user out. For example,… Continue reading Symfony Logout Handlers vs Logout Success Handlers

Custom User Provider Factories for the Symfony Security Bundle

Symfony has some great documentation on adding custom security authentication providers, but there is a similarly mature system for user providers. While there is support for custom user providers already which are defined as services within an application, I was looking for a way to provide something similar to the way memory user providers work:… Continue reading Custom User Provider Factories for the Symfony Security Bundle

Making Multiple Instances Play Nice with Symfony’s Autowiring

Autowiring & Multiple Instances

Symfony's autowiring is one of the best things to come to the framework in the 3.X series. Without it we would all still be extending ContainerAware base classes and be using a service locator. But what if we need multiple instances of somethign in the container? The docs talk about dealing with multiple implementations of… Continue reading Making Multiple Instances Play Nice with Symfony’s Autowiring

In PHP Use is More Like an Alias than an Import

PHP Use is an Alias

PHP has a use statement that allows the importing or, more accurately, aliasing of classes into the current namespace. In other languages, like Python, importing a nonexistent class or module will fail at the import. In PHP, this doesn't happen, instead the program will fail later when the aliased class, function, or constant is is… Continue reading In PHP Use is More Like an Alias than an Import

Posted in PHP