JoeSniff

Joseph Wilk - JoeSniff

Joseph Wilk’s Blog - Monkey amongst men

Rspec Stories - Keeping Steps Dry

When using Rspec stories you have plain text stories which we call the 'story' file and the 'story steps' file that maps the plain text story to programmatic code. Generally you end up with your story files not being DRY. This is not a worry, your stories are the domain specific languages detailing your acceptance/integration tests. Its like saying that your Rails Models are not DRY because they ...

Dynamic Getter/Setters for PHP

Tags:

We use the magic __call method in PHP which is called on an object when a declared function is called on it but it does not exist. This behaviour allows us to have default getters/setters but if we want specific behaviour for a get/set we just have to add the function to the class and __call will no longer be used for that class attribute. [viewcode] src=../projects/php/GetSetExample.php geshi=php[/viewcode]

Curl and Certificates with Windows PHP

Tags: ,

Curl on a Windows PHP installation does not know where to look for certificates. Hence when you try and curl a https url it fails. The default value for CURLOPT_SSL_VERIFYPEER is true which means curl will always try and validate ssl by default. I discovered this while working with an OpenID library (v1.2.3): http://openidenabled.com/php-openid/ There is the option of disabling the verfication. $ch=curl_init; // set URL and other appropriate options curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); But thats ...

Continue