I've written an ActivityPub server which only allows you to post messages to your followers. That's all it does. It won't record favourites or reposts. There's no support for following other accounts or receiving replies. It cannot delete or update posts nor can it verify signatures. It doesn't have a database or any storage beyond […]
Continue reading →
I once described my ideal coding environment to a colleague as "telneting directly into prod and damn the consequences!" I jest. But only a little. When I build for myself I treat best practices and coding styles as harmful. Chaotic evil but, hey, it's only myself I'm hurting. Anyway, my wife and I run a […]
Continue reading →
I am using Auth0's Symfony library to allow users to log in with their social network providers. It works really well. Using this firewall configuration, a user who visits /private is successfully taken through the login flow and I can then use $this->getUser() to see their details. security: password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' providers: users_in_memory: { memory: […]
Continue reading →
This pissed me off and I couldn't figure out what I was doing wrong. So I'm blogging about my ignorance. Imagine you're using Symfony and Doctrine to access a database. You are using prepared statements to prevent any SQL injection problems. There are two main ways of doing this - and they disagree about how […]
Continue reading →
I couldn't work out how to use Route Aliasing within my controller. I couldn't find anything in the documentation about it. But, thanks to a StackOverflow comment it is possible. Suppose you want users to be able to access a page using /users/123 and /people/123 - with both routes displaying the same data? Normally you'd […]
Continue reading →
I'm just getting started with Symfony, so I'm blogging some of the weird things I'm finding. Symfony has a concept of Cache Contracts. You can call an expensive / slow / intensive operation and immediately cache the result for a specific time period. Next time you call the operation, the results are served from the […]
Continue reading →
I'm just getting started with Symfony, so I'm blogging some of the weird things I'm finding. I want to use Doctrine dbal to search a database for a partial match. For example searching for "smith" should find "blacksmith" and "smithy". I have a prepared statement like this: $queryBuilder = $conn->createQueryBuilder(); $queryBuilder ->select("whatever") ->from("table") ->where("name LIKE […]
Continue reading →