My glorious four-day weekend is just about over and I did a bunch of coding and no writing. I did, however, sit happily in air-conditioned bliss. When the humidity makes it feel like 46C (114F), you kind of don’t want to move, much less leave an air-conditioned room.
I made a lot of progress on switching things over to PDO from mysqli, but it’s still not done. I’m still flailing around, trying to figure out wtf the problems are that I’m experiencing. Here are some of the issues I’ve had so far this weekend, all of which are resolved:
- I had an errant space in <?php. And that borked everything that came after it. Why I didn’t see the space between the question mark and the p is unknown.
- I couldn’t figure out how to copy a file to the directory above (and thus, outside) the web directory in my PHP Docker container.
- I further couldn’t figure out how to actually edit a file in that directory once I was able to copy it, but then inserted a nano install in my Dockerfile. (My original linux/unix experiences were heavy on pine, tin and pico.)
- I decided to actually create and use limited-access users for the database calls (as one should) and then had a hell of a time ensuring they could connect to the MySQL Docker container.
- Even with limited-access users being valid users, I couldn’t run a simple select statement.
All that’s been taken care of. Now it’s a matter of actually writing the code to get a question pulled from the database, displayed to the user and then matching their typed answer with the answer in the database. I gave it a couple of half-hearted attempts tonight, once I finally got one of my database users to properly make a select statement, but figured I’d accomplished enough.
A lot of it this weekend was making sure things were being done right. It’s hilarious how I’m still not to the point where I was when I was writing things with mysqli. Just need more time. This is not going to be simple and it’s not going to be solved quickly.
Speaking of “quickly”, the process of starting up my Docker containers is not so much with the speed. I obviously desperately need to update my computer, because there’s not a lot going on in that startup process, but it takes — and I timed it — upwards of eight minutes to get both the PHP and MySQL containers running. Now, this didn’t pose a huge problem in PHP II, because the containers were configured by our teacher, so we literally did docker-compose build and docker-compose up to start up and then docker-compose down when we were done. So it’s one thing to spend eight minutes or thereabouts waiting for your containers to come up when you do it once, but a whole other thing to do it numerous times in a day. Come to think of it, there’s probably a way to refresh the configuration/etc without killing the containers and starting anew, but that bears more investigation.
And speaking of refreshing configurations and such, I spent a couple of hours updating my IRC server, services and proxy monitor on Sunday. I’m a terrible person because I don’t update often and, when I do, it’s usually because a new major release has come out. As such, I generally have to start from scratch because various updates are incompatible with my existing configuration file. But not this time! So I backed everything up (like, twice) and then proceeded to install over my IRC server with the new version and then restarted the server and that worked fine. Same with services. Same with the proxy monitor.
I’d set aside three hours for it and it barely took two — and that included all the backing up and reading I was doing to ensure I knew what the hell I was doing. It went so smoothly! I fully expect the earth to open up and swallow it, now.
And on that note, I should go to bed. Back to work tomorrow and I’ll be working from my air-conditioned living room instead of my non-air-conditioned office.
I’ll post some pics of my living room desk with and without my work laptop next time! I’m really loving how it’s turned out.