When writing PHP for AWS Lambda, Bref is the way to do it. One thing I like about Bref is that you can use PSR-15 Request Handlers to respond to API Gateway HTTP events as documented in the API Gateway HTTP events section of the Bref docs. The request handler is the same as used in PSR-7 micro-frameworks like Slim or Mezzio and can be thought of as a controller action. As such, it's really… continue reading.
One thing that has annoyed me about receiving email is so-called tracker pixels. These usually 1x1px transparent images that are remotely loaded into HTML email enable the sender to track information about be. A good resource about them is No To Spy Pixels. As such I've tended to run my email clients with remote resource loading disabled, which isn't the best experience as a surprising number of legitimate email even display the call-to-action link as… continue reading.
With the release of Big Sur, my scripts for keyboard control of macOS notification alerts stopped working. With a bit of experimentation and help from Google, I have written new ones. Closing an alert To close a notification alert on Big Sur, conceptually we want to press the X button that appears when you hover over it. The AppleScript to do this is: activate application "NotificationCenter" tell application "System Events" tell process "NotificationCenter" set theWindow… continue reading.
I'm very happy to be speaking at The Online PHP Conference this year. As you can guess from the title, this is an online event so is easily accessible right from your desk. thePHP.cc have very kindly made available a couple of tickets to me, so you could attend for free.
As we reach the end of 2020, I continue my tradition of looking back at my year through the photos that I took as I have done every year since 2009. I have been doing a Project 365 for a good few years which acts as a diary too, so I have the opportunity to appreciate what happened this year in my life. This has been quite a year with the pandemic hitting the UK… continue reading.
Since 1Password added Apple Watch unlock I've wondered if there are other situations when I need to enter my password where it instead require a click of my Watch instead. I recently came across an article about how to make sudo work with Touch ID, which is nice, but my iMac Pro doesn't have Touch ID. I went searching though and found pam-watchid! This is a PAM module for using the Watch – exactly what… continue reading.
When working on OpenWhisk, I discovered that it needed a different Java to the one I had installed. Looking around the Internet, I discovered jenv which shouldn't have surprised me as I use pyenv and I'm aware of rbenv too. As I use Homebrew, these are the commands I used. Firstly install jenv, the latest Java (15 at this time) and any other versions you need. Java 8 and 12 in this example: $ brew… continue reading.
UPDATE: Since this was published, PR 1087 has been raised and merged with restores pecl to the Docker PHP 8 images. I discovered recently that pecl is no longer shipped in the PHP Docker images for PHP 8. This appears to be related to the deprecation of –with-pear in PHP core as noted in issue 1029. Consider this Dockerfile: FROM php:8.0.0RC5-cli-buster RUN pecl install mongodb && docker-php-ext-enable mongodb If you build, you'll discover the pecl… continue reading.
One of my clients runs their own Composer repository for some packages which is hosted on internal system where the SSL is signed by an internal root CA cert. I installed the relevant certificates into my Keychain, but Composer complained about not being able to trust the certificate. I use the Homebrew version of PHP which links to Homebrew's OpenSSL, so I realised that OpenSSL wasn't looking at the keychain, but instead at its own… continue reading.
I recently needed to modify the emails that a client project sends out. It was set up to send via SMTP and so the easiest way to do this for me was to add a local MailHog instance and point the application at it. Manually running via Docker The quickest and easiest way to do this is via Docker. Manually, we can do: $ docker run -p 8025:8025 -p 1025:1025 mailhog/mailhog This will run MailHog… continue reading.