PHPNews

Connecting PHP to MySQL on Bluemix

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Wednesday August 23, 2017 - Permalink

Most of the PHP I write runs on Bluemix - it's IBM self-service cloud, and since I work there, they pay for my accounts :) There are a bunch of databases you can use there, mostly open source offerings, and of course with PHP I like to use MySQL. Someone asked me for my connection code since it's a bit tricky to grab the credentials that you need, so here it is. Bluemix Environment Variables …

Continue reading »


Removing Object Properties Before Var_Dumping Them

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Friday August 11, 2017 - Permalink

I'm working on a project at the moment (a PHP library for CouchDB , if you must know) that is designed to make HTTP calls and therefore holds a Guzzle HTTPClient object as an object property. This is great except when I need to debug something and the output of my call to var_dump() is several screens high ... There's a Magic Method for That It's possible to amend the behaviour of …

Continue reading »


Handling Incoming Webhooks in PHP

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Monday July 24, 2017 - Permalink

An increasing number of applications now offer webhooks as an integration, often in addition to an API. The classic example, familiar to most developers, is the GitHub webhooks which can notify your other systems such as CI tooling that a new commit has been added to a branch. If you imagine how many repositories exist on GitHub, and how many other systems react to changes on each repository …

Continue reading »


HTTP Tools Roundup

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Monday July 3, 2017 - Permalink

At a conference a few days ago, I put up a slide with a few of my favourite tools on it. I got some brilliant additional recommendations in return from twitter so I thought I'd collect them all in one place in case anyone is interested - all these tools are excellent for anyone working APIs (so that's everyone!). First, my original slide: The starter set of tools looked like this: …

Continue reading »


Deploying OpenWhisk Actions With Dependencies

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Thursday June 29, 2017 - Permalink

I mostly use OpenWhisk with NodeJS (which is lucky for me, it's the best supported of the languages and default for the documentation examples!) and while there are a bunch of npm modules already installed on OpenWhisk, sometimes there will be others that you also want to include. Alternatively or additionally, you might also want to deploy your package.json since this can specify the entry …

Continue reading »


Building Conversations With Alexa

Written by Lorna Jane - Published on Lorna Jane's blog
Aggregated on Monday June 26, 2017 - Permalink

Having an Amazon Echo Dot in my office is quite fun, and I've accidentally started writing more skills and giving a few talks about building skills for the Alexa toolchain. Today I created a skill that uses multiple steps to make a conversation and thought I'd better write down what I did so I'd be able to remember! The basic idea is that when creating the "intent", i.e. the action that you …

Continue reading »