Author Archives:
Simple One-to-one Meetings
- What’s going well/what are you excited about?
- What’s tedious/annoying or actually a problem?
- What could I be doing that I’m not?
Use Ngrok for Testing APIs on Dev
Handling Composer “lock file out of date” Warning
composer.json
where you specify your dependenciescomposer.lock
where composer itself records exactly which precise version of every library and every dependency of every library it picked, so all installs will be identical
Crucially, the composer.lock
also includes a hash of the current composer.json
when it updates, so you can always tell if you’ve added a requirement to the composer.json
file and forgotten to install it. Continue reading
PHP Web Services: 2nd Edition

Writing a second edition was nothing like writing a first edition, it’s more like editing with snippets of writing and rewriting thrown in. My heartiest thanks to my tech reviewers who sorted out all kinds of nonsense contradictions and generally asked hard questions during the process – you are all humans of the highest calibre :)
Upgrade To Better Passwords in PHP
OAuth2 with PHP’s built in Streams Functions
(this drives me nuts, I love upgrading systems but the downside is you have to work with the old ones first and none of the tools you want have been invented yet!)
For OAuth2, all I had to be able to do was to send an Authorization
header with my web request from PHP. My second-favourite way of making API calls from PHP is to use PHP’s stream handling, so I did that. It’s not code you see very often but it’s super-simple and it works on every PHP platform I’ve tried so far, so here’s an example:
// assemble the options $opts = array( 'http'=>array( 'header'=> "Authorization: Bearer " . $access_token ) ); // create the context $context = stream_context_create($opts); // now make the request! Use the context and simply output the result echo file_get_contents('http://api.example.com/endpoint1', false, $context);
If you’re trying to make an API call from PHP and installing better tools is hard for any reason, this example may help!
API Testing with Runscope
Relying on A Dev-Master Dependency in Composer
If your project installation instructions recommend requiring dev-master in composer, I may need to reconsider my choice of package
— Lorna Mitchell (@lornajane) December 2, 2015
I got a few responses asking me to expand so I thought I would take the opportunity to write more than 140 characters on this topic. Continue reading
Insert Data with Phinx
change()
description.
One thing I didn’t immediately find was how to insert data. Continue reading