Paranoia 2.1

Mai 7th, 2011

Following the latest coverage on Facebook’s iframe button tracking capabilities (even when not clicking it or being logged in) – which were evident beforehand, but had to be brought to general awareness by the yellow press – here come three simple lines of Adblock Plus configuration, which make browsing the web a little „safer“ for all those concerned. That is, as long as you don’t want this to ever work, because you are neither active Twitter nor Facebook user.

Custom blocking rules:

*api.twitter.com/1/urls/count.json*
*twitter.com/widgets/tweet_button.html*
*facebook.com/plugins/like.php*

The incident has yet again proven – just because you are paranoid, does not mean that they are not follwing you…

Januar 29th, 2011

„A society is only three meals away from anarchy.“

Ian Maclaren

Doctrine 1.2.3 Segmentation fault

Oktober 9th, 2010

Today we learned, that – with the stars properly aligned – doing the right mistakes in using Doctrine can actually make PHP cause a Segmentation fault.

So far I have not been able to reproduce the problem in an Apache environment; but running PHPUnit from the CLI, the issue could be reproduced consistently.

The root of the evil is using Doctrine’s Behaviour/Templates in an ill-advised way. In this particular situation, a model had a behaviour defined and, at the same time, a custom column definition for columns also specified by the behaviour.

Doctrine does a lot of internal magic — possibility for behaviour parameter validation is unfortunate, though. When creating your own behaviours for example, throwing exceptions to notify the programmer using the behaviour that some of the passed parameters are invalid, Doctrine catches and „swallows“ these so they never can be seen and considered… So far, looking at e.g. unit tests for the build-in behaviours I have not figured out how to do this „right“.

Anyhow, a Segmentation fault should hardly be the result of any configuration mistake. I will try to create a test case in a fresh environment (other that the fair size project this happened in), and take a closer look on how to reliably reproduce the issue and use a debugger to confirm the reason really can be found inside Doctrine’s code or if some other 3rd party software (XDebug, …) has any influence.

August 12th, 2010

„Niveau sieht nur von unten aus wie Arroganz.“

anonym

Finding PHP4 constructors in Eclipse

August 11th, 2010

With PHP5.3.3 its time to remove some dust from your old code. Aside of the fact that most of us would want to look into legacy projects, checking for issues someone else has solved more elegantly in the meantime, support for the old contructor names (a function identical to the class name) will be dropped. This means the old code will have to be ported.

As I am not a friend of automated code modification I searched for a way to find concerned classes via the Eclipse file search – using regular expression. This should do…

(?s)^(class\s+(\w+)\b.*^\s+function\s+)\2\b