PHP Quick Stack Trace in Exception Handler

PHP and frameworks built from it have many great tools to assist with debugging (I particularly like XDebug) but sometimes you can find yourself in a situation where the "helper" features aren't all that much help ... in my case this was a framework totally determined to output HTML from my commandline script and to only show me 5 lines of stack trace, which wasn't enough for my complex application. I had to look up how to generate a nice stack trace inside an exception handler so here it is in case I want it again some time (future me, you're welcome!) Continue reading

Test Incoming Webhooks Locally with Ngrok

I'm enjoying working with hubot; I have a few different instances running for different groups. One of the things that I use hubot for is to echo activities from the source control repo, the bug tracker, the CI system, the (you get the idea) into the channel for a project. This is achieved via webhooks; a feature offered by many providers to POST information about an event to your endpoint as soon as it happens. Continue reading

Organising Inclusive Events

I've been thinking a lot lately about what makes an inclusive event. Not gender-inclusive, necessarily (I commonly find myself as the only woman developer at both my local user groups), just approachable, maybe for newcomers but mostly for everyone. What happens at the event itself is really important, whether people greet you, whether the speakers introduce themselves, and so on. That's only half the story though, because often we've excluded people from our events before the event begins. Every conversation I have about this topic comes back to information. Continue reading

Hubot with Git Submodules

I love hubot and use one in a few different places. One thing I do find though is that I often want to edit or evolve those plugins, and it seems somehow unethical to just hardcode my changes into my own repo. Once I figured out how to wire together a forked repo as a submodule, it became much easier to work with hubots with external plugins, so I thought I'd share my recipe for that. Continue reading

Git: upstream is gone

I came across a git repo recently that output this message with every operation I did:

Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

I was delivering a workshop at the time so I kinda snarled at it and carried on with what I was doing, but later I looked up what is happening. This occurs when a branch is tracking a branch that the git repo doesn't have any information about - the branches to be tracked aren't in the local repo metadata.

In my case, it happened because I had created and then cloned an empty repo for training purposes - so origin/master didn't actually exist yet! I added a quick commit-and-push to my script and hope that I won't be upstaged by this change that came in with git 1.8.5.

Hopefully this post will help someone else to avoid being upstaged or irritated by this as well!

5 Reasons to Consider Upgrading Your PHP Platform

In recent years, the release cycle of PHP has become much shorter. We now have a much more controlled and well-publicised process of releases, and moving between each version is no longer a leap of faith. The newer versions have HUGE performance improvements, great features, and better security, and the software is free to use. Yet we have a very, very long tail of PHP installations on older versions (around 75% on entirely unsupported versions at this point). Many of the companies I talk to think that upgrading will be pointless and painful, but that's not my experience of migrating PHP projects. Here are a few things you might like to think about or be aware of before you make the decisions that "not broken" is good enough for your applications. Continue reading

ZCE Preparation Pack

tl;dr version: the ZCE Preparation Pack is now available from Leanpub costing $30.

I've been running a preparation course for the Zend Certified Engineer exam for many years now.  Once upon a time it was possible to buy a pack of sample exams and I used them myself when preparing for certification and also recommended them for all my students.  Unfortunately this resource became unavailable and so I created a sample exam to use with my own course .... and then (after some nagging!) made it generally available.

I've now relaunched the pack on a new platform (for boring regulatory reasons); its new home is on Leanpub which is a fantastic platform for authors, offering markdown authoring, github integration, and many other awesome features.  Perhaps more importantly, it also offers great features for readers: a 45-day money back guarantee and automatic updates to any book you have bought.

If you're thinking of improving your skills by studying for ZCE or considering upgrading your certification to the current version (PHP 5.5), this pack will help you to prepare.  It includes:
- Advice on what to expect on the day
- One exam's worth (70) of questions in the style of the ZCE
- Answers with explanations, worked examples, and resources for further study

Help yourself get ready for ZCE:

Gollum the Git-Enabled Wiki

In trying to get company documentation off google docs and people's laptops and into a more useful format, I have been researching developer-friendly tools for business documentation. Requirements went something like:
- must handle words and documents
- should be available locally, bonus points for revision history
- must publish to the web, and ideally be editable there
- should accept content in markdown
- must have access control (which wiped out my original plan of using a static site generator)

While I worked on this, we were using the wiki feature in GitLab ... which pretty much hit the nail on the head. Further investigation showed that the wiki feature in GitLab (and indeed in GitHub) is a ruby gem called Gollum. Continue reading

Set Up Your First Hubot

It took me far too long to get my first hubot working; when I finally sat down to get it going the process was much easier than I expected! So here's a little guide in the hope that this helps you get started too.
Continue reading