WordPress comment spam post fail
While trying to block spam posts on a forum, I noticed this gem. No doubt someone’s spam sending program has failed, just a little…. { {I have|I've} been {surfing|browsing} online more than...
View ArticlePostgreSQL unbuffered queries and PHP (cursors)
From using MySQL, I’ve used the ‘unbuffered queries‘ feature a number of times. It’s where you don’t fetch the entire resultset into memory at once – which is necessary if you’re retrieving more data...
View Articleack-grep config – ackrc – adding new file types
I needed to add some more file types for ack-grep to find / search when I’m looking for PHP code that resides in files with non-standard extensions (e.g. something.def, something.inc etc). Annoyingly...
View ArticlePHP 5.4 + xcache -> PHP 5.6 + Zend OpCache memory usage
In relatively unscientific tests, it seems moving from PHP5.4 with xcache to PHP 5.6 with Zend’s OpCache can lead to approximately 50% memory reduction. (xcache was set to have a 64mb size, Zend...
View Articledotdeb – apt package pinning
As of last night, Debian Security released PHP 5.4.44 for Wheezy. Wheezy shipped with PHP 5.4.12 or something like that. DotDeb is currently on 5.4.43, and if you’ve been using it based on the...
View ArticleRandom wordpress malware
A customer’s server was compromised ages ago with lots of lots of WordPress malware. The developers are now on top of it, thanks to a combination of : * Removing wordpress’s write permission (moving...
View ArticleMockery (test doubles/mocking dependencies)
[This is a relatively old post I think I forgot to publish….] Previously, I’d only used PHPUnit’s mock implementation; however lately I’ve been exposed to Mockery. While they both achieve broadly the...
View ArticlePHP Generators – an example
I’ve ignored generators for sometime in PHP, but recently realised why they can be quite handy As an example, imagine you are querying a web service, which returns data in chunks of up to 100...
View ArticleHello (again) world
I don’t blog very often. I should probably stop bothering with the automated twitter compilations. In other news, some legacy PHP code I look after had this : <?php // ......
View ArticlePHP psalm annotations
This is more of a note for myself, as I keep forgetting the syntax. See also https://github.com/vimeo/psalm and List of Arrays Given an 2d array like : [ [ 'name' => 'Pickle', 'age' => 4 ], [...
View Article