PHPNews

My Bref Makefile

In order to use Bref efficiently, I've developed a Makefile so that I don't have to remember all the various commands required. In particular, looking up the correct parameters to sam package & sam deploy is a pain and it's much easier to type make deploy and it all works as I expect. It looks like …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday May 15, 2019


PHP Architect: Serverless PHP With Bref, Part 1

I've written a two-part series on Serverless PHP on AWS Lambda using Matthieu Napoli 's Bref for php[architect] . Part one has been published in the May 2019 issue and if you're not already a subscriber, you should be! If you just want to learn about Bref though, then my introduction to Bref is available …

Continue reading »

Written by Rob Allen - - Aggregated on Thursday May 9, 2019


Slim 4 Cyclomatic Complexity

There's not much wrong with Slim 3 ; lots of people are using it very successfully producing APIs and websites of all kinds. For Slim 4 the main goals have been to support PSR-15, make it easier to use your own PSR-7 implementation, improve error handling and remove assumptions that look magical if you don't know …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday April 3, 2019


rst2pdf: back from the dead!

Today marks a momentous day! I've released 0.94 of rst2pdf to PyPI ! If you have a need to convert plain text files to PDF, check it out. As the last release, 0.93, was December 2012, I think you could have reasonably assumed that the project was abandoned. So why did I bring it back from the dead? …

Continue reading »

Written by Rob Allen - - Aggregated on Thursday January 24, 2019


Keyboard control of macOS notification alerts

I use Apple's Reminders app to remind me about things that I need to do. It has the useful feature of syncing across my Mac, iPad and iPhone and I can add to it via Siri in my car. When I am notified on my Mac, a notification alert appears with two buttons: Complete and Later . Clicking Later offers a set of …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 9, 2019


Setting up IBM Cloud Object Storage

For a little website that I'm writing, I thought that I'd use IBM Cloud Object Storage (equivalent to AWS S3) as I'm generating the pages using OpenWhisk on IBM Cloud Functions . The documentation is quite good if you want to use the website, but is a bit spread all over the place if you're using the command …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 9, 2019


Serverless PHP on AWS Lamda

Like, Simon Wardley , I think that serverless computing is an interesting space because the billing is granular (pay only when your code executes) and you don't need to worry about maintaining and provisioning servers or containers. So much so, that I maintain the Open Source PHP Runtime for Apache OpenWhisk …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 2, 2019


2018 in pictures

As 2018 draws to a close, I take the time to look at the past year as I have done in years past , I look at the photos that I've taken and reminisce about all that I've done this year. January I started the year with ongoing efforts to reduce the pain in my joints and then visited America for CodeMash in …

Continue reading »

Written by Rob Allen - - Aggregated on Monday December 31, 2018


Autojump is magic

One of my favourite command line utilities is autojump . It's a small command line utility that allows you to change directory without having to remember exactly where that directory is. For example, to start working on OpenWhisk, I simply type: j openw And the current directory is changed to /Users/rob/Projec…

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday December 19, 2018


Upgrading to Bash 4 on macOS

Incredibly, macOS Mojave comes with Bash 3.22 by default still. Apparently this is due to licensing reasons, however Bash 4 has lots of lovely features including associative arrays that I'd like use. Hence, after reading the Internet for a bit, I've installed it on my Mac. This turned out to require just 3 commands: …

Continue reading »

Written by Rob Allen - - Aggregated on Friday December 14, 2018


Route specific configuration in Slim

A friend emailed me recently asking about route specific configuration in Slim. He wants to be able to set properties when creating the route that he can pick up when the route is matched. The way to do this is using route arguments. I've written about route arguments before in the context of setting default …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday December 12, 2018


Migrating to password_verify

I've recently been updating a website that was written a long time ago that has not been touched in a meaningful way in many years. In addition to the actual work I was asked to do, I took the opportunity to update the password hashing routines. This site is so old that the passwords are stored using MD5 hashes …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday December 5, 2018


Analysing the focal length of my photos

I'm currently thinking about upgrading my camera to an EOS R or Z6 and, as result, I'm thinking about which lenses I should get. While discussing options with Stuart , I wondered which were my favourite focal lengths for the photos that I've taken in the past. To work this out, I decided to use the wonderful …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday September 26, 2018


Using .vimrc for project specific settings

I'm more of a spaces person than a tabs person when it comes to source code and in Vim, I like to see the tab characters, so I have this setting: set listchars=tab:\⇥\ ,trail:·,extends:>,precedes:<,nbsp:+ This places a handy ⇥ character so that I can see the tabs: I'm currently working on a …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday July 25, 2018


Notes for working on the OpenWhisk PHP Runtime

These are some notes for working on the OpenWhisk PHP Runtime , but are probably applicable to the other runtimes too. Setting up I have a clone of the runtimes I'm interested in and core side-by-side in a directory. You then need various tools for development, which are documented here for macOS & …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday July 4, 2018


Using Fractal as your OpenWhisk API's view layer

When writing an API, it's common to produce an output that conforms to a known media type such as JSON API or HAL , etc. I'm a strong believer that even though I'm writing an API, my application has a view layer. It's not the same as building an HTML page, but you still need to separate out the code that creates …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 27, 2018


Dependency Injection with OpenWhisk PHP

Any non-trivial PHP applications use various components to do its work, from PDO though to classes from Packagist. It's fairly common in a standard PHP application to use Dependency Injection to configure and load these classes when necessary. How do we do this in a serverless environment such as OpenWhisk ? This …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 20, 2018


Using API Gateway with Serverless & OpenWhisk

As with all serverless offerings OpenWhisk offers an API Gateway to provide HTTP routing to your serverless actions. This provides a number of advantages over web actions , the most significant of which are routing based on HTTP method, authentication and custom domains (in IBM Cloud). Creating routes with the wsk …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 13, 2018