Quantcast
Channel: php | David Goodwin
Browsing latest articles
Browse All 20 View Live

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 Article



PostgreSQL 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 Article

ack-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 Article

Image may be NSFW.
Clik here to view.

PHP 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 Article

dotdeb – 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 Article


Random 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 Article

Image may be NSFW.
Clik here to view.

Mockery (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 Article

Image may be NSFW.
Clik here to view.

PHP 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 Article


Hello (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 Article


PHP 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
Browsing latest articles
Browse All 20 View Live




Latest Images