While using Psalm, Vimeo’s static type analysis tool for PHP, I ran into an unexpected type issue on a couple of model files. What I had always assumed to be an integer (the return value from PDO::lastInsertId(), turned out, in fact, to be a string.
Archives
bookmark_borderPsalm: Static Type Analysis for PHP
Yearning for a Typescript-like static type analysis tool for PHP? Vimeo’s engineers, in an attempt to maintain and grow their own PHP codebase, have developed one… and open sourced it. Checkout Psalm.
bookmark_borderInstalling MySQL client without server on Mac
How to install the MySQL monitor shell on a Mac, without installing the Community Server. It’s not available as a standalone download. But this works.
bookmark_borderSharing a network between standalone Docker containers
How do you connect two standalone docker containers to that they share a network and can communicate. Specifically, how to connect a PHP/Apache container to a Mysql/Mariadb standalone container.
bookmark_borderSimple Docker LAMP stack
My lovely Vagrant setup on my Intel Mac Mini was broken last month when I upgraded to a Mac Mini with Apple Silicon. No more seamless switching workflows between my Mac and my Windows laptop! Luckily, Docker containers came to the rescue.
bookmark_borderAdd Bootstrap to Vue CLI project
Adding Bootstrap (or any other CSS framework) to Vue is fairly straightforward. In this example, I’ll install the entire Bootstrap CSS library (without javascript, no jquery, no popper.js, which are dependencies if you want everything Bootstrap).
bookmark_borderDisable PHP in Uploads Folder using Apache Vhost rule
It’s a best practice to disable PHP in any folder where users might upload files. Usually, I would just place an `.htaccess` file in the uploads folder with a simple directive to disable execution of any PHP files. It can also be done in the vhost file.
bookmark_borderAdd Certbot to Ubuntu 20.04
The docs for Certbot on Ubuntu 20.04 only give instructions for installing using snapd. I don’t use snapd. Forums seemed to suggest that was the only way. But using standard apt commands seemed to work fine.
bookmark_borderHello world!
Well, I’ve finally decided I need some kind of blog, mostly to keep track of all the things I tend to forget in the fray. Until recently I was adding notes to a document management system, but it had become unwieldy.