So, Saffire started as a way to “learn” a bit about flex/bison. I’ve dealt with these systems before a long time ago (pre-2K), and i forgot lots about them. So it was about time for a refreshal. Unfortunally, looking on the internet for tutorials, almost all of them are about how to write a calculator (bison’s version of “hello world”, most probably). Very soon, I decided to try and parse my own language, with some idea’s I collected over time on how *my* favorite language should look like. Two hours later: Saffire was born.
Even in these days, with full-featured PHP IDEs around, I still see PHP developers using
die() to debug
their code. Not only is this a very bad way of “debugging”, it has other dangers as well, like side-effects on calling
(non-idempotent) methods multiple times, not removing debug statements and possible even committing this to the VCS
repository, which gets send onto your production environment. We’ve probably all been there,.. But we don’t have to.
Debugging your code properly through an IDE is quite easy, but one of the major problems is debugging CLI code. Since
many frameworks like Zend, Symfony and micro-frameworks like Cilex can be used to create command-line apps, cronjobs
and even daemons, so how do we easily debug this kind of code?
One of the many things I do, on pretty much a weekly basis, is answering questions about
HTTP. Is this status
code correct for X, should I use POST or PUT, is this hateoas enough, how do i handle logins in a RESTful API etc,
etc… This is why I decided to setup a simple website, that pretty much tries to answer any question about REST. It’s
not completed yet.. Actually, it hasn’t got many posts to begin with :), but a start has been made and we will fill it
with questions and answers about REST and HTTP issues.
A few months ago I started with a new programming language called Saffire, and it’s time for an update. Since then, we have merged over 100 pull requests, and the number of contributors is steadily increasing. This post is explains of the functionality we already implemented (or want to implement).
I love working with composer. I think it’s a really neat way of dealing with dependencies in (PHP) projects and it’s not for nothing that big frameworks like symfony2 are using composer as their primary way of handling bundles and other components. But this blogpost is not about problems with composer (well, not really anyway). It’s about installing composer. It is fundamentally wrong, and it sets a very, very bad precedent for both experienced and inexperienced (php) developers.
Tags: [ ast ] [ bison ] [ flex ] [ grammar ] [ lex ] [ saffire ] [ yacc ]
In the last blogpost I was talking about a new language in the making. Unfortunately, writing a complete new language - from scratch - isn’t as easy and takes a fair bit of time. During this development process, I will try and blog a bit on the things we are developing, the problems we are facing and the solutions we are implementing. The current Saffire status: we are able to generate AST tree’s from Saffire source programs. If you have no clue what I’m talking about, no worries: this blogpost will try and explain it all.
Tags: [ annotation ] [ bundle ] [ multiparamconverter ] [ symfony ] [ symfony2 ]
If you know Symfony2, you probably are using (or at least, have heard of) the [@paramConverter annotation] from the SensioFrameworkExtraBundle. This is a really simple way to convert slugs into entities. But lots of times I find myself having multiple slugs inside my routes, and this is something the @paramConverter annotation cannot do. So that’s why I’ve created the multiParamConverter.
Tags: [ oauth ] [ offloading ] [ varnish ]
For a current project both me and a [colleague] are working on a big API system that authenticates through an OAuth system. Normally, such an API does all the necessary OAuth checking, handling of tokens etc, but we wanted to have a system that actually offloads our authentication just the same way one could offload HTTPS traffic for keeping the API simple, extendible and even performant.
Tags: [ doctrine ] [ PHP ] [ proxy ] [ symfony2 ]
Doctrine’s DataFixtures are a great way to add test data to your application. It’s fairly easy to get this going: Create a fixureLoader that extends Doctrine\Common\DataFixtures\AbstractFixture, had a load() method and off you go. However, sometimes you want your data also to be protected by Symfony 2’s ACL layer. Since there isn’t a common way to do this, here is one way on how I implemented this
Tags: [ puppet ] [ symfony2 ] [ vagrant ]
As you may now by now, I’m a big fan of using Puppet for configuration management. Since the rise of virtualization,
these applications are becoming one of the more dominant tools in a developers tool chain. Together with other tools,
setting up a complete development environment with just a single command is not only reality, but it’s becoming for a
lot of developers a daily practice. But even for open source projects like
This year the DPC (and DMC) bought all speakers one of the coolest gifts I’ve ever got (or seen) for speakers: an Arduino. During the speaker dinner, a lot of people were a bit confused on how it was and works. So this post is for all of those, plus everybody else who wants to get involved in Arduino, programming and some electronics. It really is fun!
Even though I really like using sed and awk, sometimes its hard to change or add parameters in configuration files. Big sed statements that may or may not work, double checking if everything has been done correctly etc. Augeas is a really cool tool that lets you view / add / modify and delete all kind of data from configuration files. If you are using Puppet, you are probably aware of this tool, but I notice that a lot of PHP developers have never heard of it.. Let’s explore..
Tags: [ http ] [ rest ] [ see other ]
During a [presentation] I gave yesterday about REST, there was a discussion about redirection (more detailed, a redirection from a queue to the actual resource during [asynchronous operations)]. During this presentation (and blog-post), I’m using a [303 HTTP status code] to indicate that the operation has been completed and that the created resource can be found at another URI. So in essence, it makes sense to use a 303. At least to me, and quite possibly the rest of the world too.. But this triggered a side-discussion on which HTTP status code to use, and the more I think about it, the more complex it believe this problem actually is.
In a span of two months or so, I’ve noticed a peak in implementation of bloom filters. Maybe the “if you got a hammer, everything looks like a nail” applies here, but statistically I’m doing a larger number of bloom filter implementation as usual. Yet, most of my co-workers never really heard of bloom filters, and I’m continuously need to explain what they are, what their purpose is and why it’s a better solution than other ones. So let’s do an introduction on bloom filters.