Ideas of March
I’m seeing increasing numbers of my friends and peers announcing that blogging is coming back into fashion, which came as a surprise to me since I didn’t realise it had gone out of fashion and I’ve been blogging regularly without realising how uncool that was! With twitter managing to annoy everyone in the last week or so either with a new client, bad behaviour towards existing 3rd party clients, or reassigning twitter names, change is in the air.
Personally I like to blog, it’s a platform that I control, and I’m always too verbose for 140 character limits (which is a nice way of saying that I talk too much – if you’ve met me in person then you knew that already!). The blogs, and perhaps more importantly their comments, are the best way I know of sharing ideas and having those accessible and grouped together if you want to refer back to them at any point in the future. They are also wonderfully asynchronous; I see some great posts coming past about technologies that I don’t use, then find myself reading those articles a few months later when I’m onto the next project. Having the various blog posts, even those short ones that people think “don’t qualify” or “aren’t good enough”, really help me get started with something new – and I try to leave the same trail on my own blog and in the comments of others’ when I’m figuring things out that I think others might come up against later (where “others” includes me, if I have slept since writing the blog post!).
So – will you join us? Will pledge to blog, or to comment on blogs, in March? Here’s to a revival of blogging (and some continuation from those of us who fail at being with the cool crowd!)
Github To Jira Bug Migration Script
The PHP Community Conference
The event is entirely community organised and run, rather than being backed by an organisation. I am a great believer in having events come from the community that wants to attend them, and as an organiser (both for community and organisation-backed events) myself, the freedom to do things that will really work, rather than things that can be agreed by a management committee, makes the difference between a good event and a great one. What’s different about this PHP Community Conference is that most of the organisers are speakers and attendees of some of the biggest conferences in the PHP world … and they’ve built the international-level conference *they* want to attend!
The lineup is nothing short of stellar, these guys and gals would be the main feature at most of the other PHP-specific events I’ve been to, in fact three or four of them have been keynotes at other events I’ve attended. I’m speaking myself, which was wildly exciting from the moment I got the acceptance email right up until the rest of the schedule was published … and is now slightly daunting, in the best possible way! I’m giving a half-day tutorial on Web Services, covering all the theory points and showing you how to not only consume but also publish your own services. I work so much with APIs and being able to take the time to properly share my experiences so others can go on to build their own kick-ass services is something really special.
I can’t wait to get out to Nashville on April 21/22 and meet the speakers and the fantastic crowd of attendees that I know an event like this will draw. Which is not to say that there are not other great conferences, but I’m really looking forward to seeing something special in Nashville … I sincerely hope to see you there!
Dealing with MySQL Gone Away in Zend Framework
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
The worker is a Zend Framework application, run from the CLI, and it seemed like the Zend_Db_Adapter had no way of knowing when MySQL had let go of its end of the connection. I tried a few different things, including Zend_Db_Adapter::getConnection(), but without success – until I dug through the source code (with some help from a friend) and realised that ZF was not reconnecting at all if it thought it already had a connection. So instead, I expressly disconnected and reconnected the database handler. At bootstrap time, I place my database handle into the registry, so I simply added this at the start of the actual function that the gearman worker calls:
$db = Zend_Registry::get('db');
$db->getConnection();
At the end of my script, before it returns to the loop waiting for another gearman job, I just disconnect my database:
$db->closeConnection();
Now Zend_Db_Adapter knows that when I ask it to connect, it needs to go off and make a new connection, and everything works really well! I was seeing the errors because I’m still only testing the system so it can go days between getting any new jobs, and the timeout on MySQL is shorter than that.
A Tale of Two User Groups
PHP Days and PHP Unconference Europe
PHP Unconference Europe
A large crowd gathered very early on Saturday morning at the Pitcher and Piano, and got our briefing on how session voting works (everyone gets 4 stickers, you stick the stickers onto the sessions you want to see, the ones with the most get scheduled).
Mercurial Primer
Using Gearman from PHP
Callbacks in PHP
function myExcitingFunction() {
// do something remarkable
}
call_user_func('myExcitingFunction');
You can also call methods of objects rather than just plain functions, and this is where I tripped myself up.
Continue reading