Testing ESI behind an intranet

I work for a company with a draconian internet policy like most other enterprises whereby I am required to follow certain rules and do not have the ability to bypass certain restrictions.

On of the things that annoys me most is the fact that in my code, I have to get it to proxy requests as well which is quite easily solved by having a single entry point to your external requests (Class, functions) . The problem with this solution is when you don’t have access to the client that is making the request.

So today, I was plodding along doing boring stuff as usual when I was required to get ESI tags working locally that included content from an external box (Think a blog trying to get the headers of the main site coming from ESI). Without a proxy, no problems. But when your using EST by Akamai with no ability to allow external access, things get a bit tricky. So I hacked together this little Varnish VCL which lets me do all my ESI testing properly while still getting remote content and best of all, I can run it on my Macbook which means I no networked dependencies!

First off, I’m going to assume if you’re reading this you don’t need too many pointers so here is the link to the the setup i am pretty much using. Remember, I assume you have vhosts setup properly and have stuff installed properly

Then it’s just a matter of starting varnish with varnishd -f /etc/varnish/default.vcl -a 0.0.0.0:80

Hope this helps someone,
Dave

Creating extensible Bundles with Symfony2

One of the problems I often encounter when working on the Symfony Configuration Component is the inability to inject parameters into configuration bundles without hacking and overriding bundles. Recently I wrote a small bundle abstraction layer to formalize the way I do this with my own bundles very similar to the way that the Security Component allows extensions.

You can check it out @ https://gist.github.com/1985816

 

Revoke ACL Permissions in Symfony

Class, Service Definition and Usage: https://gist.github.com/1539784

I was doing some work on a project which required me to revoke the permissions of a user and couldn’t find anything that showed me how to do it so I did some research and came up with this little class which abstracts the verbosity of dealing with such a powerful ACL system.

Hopefully some others get some use out of it!