php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

Box of PHP

March 2023

Sharing ideas has a weird side effect that people don’t often discuss.

With in-person events starting back up, we finally took the opportunity to restart our local user group, SDPHP. I highly encourage everyone to find a local community to be a part of, learn from, talk to, and share ideas with.

A Guide to Practical Usage of PHP FFI

By Bohuslav Šimek

In this article, practical examples will teach you how to communicate with external libraries using PHP FFI. Together, we will navigate common challenges and explore the rising star of the database world, DuckDB. by Bohuslav Šimek

Problem in a Box

By Edward Barnard

Here’s an approach to software problem analysis and debugging that’s based on intuition. Come up with theories about what might have gone wrong, then set out to prove or disprove each theory. This path, taken step by step, can lead us to the solution. > > How do we know when we have arrived at the solution? That’s the technique I call “fitting the problem into a box.” When the problem fits, with no loose ends hanging out, we have almost certainly arrived at the right answer. by Edward Barnard

PHP Puzzles: Grade Deviations

By Oscar Merida

We’re continuing with grades and statistics by calculating statistics for Grade Point Averages. In the educational system in the United States, it’s a way to boil down the grades across the multiple courses taken by a student. It involves translating a letter grade back to a numeric value and then calculating a weighted average. At the end of all this, we’re left with a singular number we can use for a rough comparison between students. by Oscar Merida

Education Station: 12 Factor Applications: Parts 1-6

By Chris Tankersley

As developers, we love being able to find patterns in the things we do. We can turn these patterns into rules we invariably learn, use, and eventually modify to work for us. A few times I have talked about design patterns, which describe how different patterns in code look and should be structured. Today, let’s take a look at application patterns. by Chris Tankersley

The Workshop: What Ben Uses

By Ben Ramsey

A popular trend among developers these days is sharing the specs of one’s local development environment and listing their most often-used tools. In this month’s Workshop, guest columnist Ben Ramsey stops by to share what’s running on his machine and the tools he finds most helpful in his day-to-day work. by Ben Ramsey

DDD Alley: “Depend” toward Stability

By Edward Barnard

Something was wrong in the sense that we missed our project deadlines repeatedly. What was wrong? This one took a while to figure out. We’ll look to Seymour Cray for part of the answer, and to James Grenning, one of the original signers of The Agile Manifesto, for the rest of that answer. by Edward Barnard

Security Corner: InfoSec 102: Phishing

By Eric Mann

Continuing on last month’s trend, we want to spend some time defining and explaining some of the terms and jargon frequently used by practitioners in the security community. Fortunately, this month’s term is likely one you’ve already come across in business: phishing. by Eric Mann

Artisan Way: Laravel 10: New Features and Upgrade Impacts

By Matt Lantz

Upgrading a Laravel application has rarely been considered a “large process”, but a version of Laravel is released every now and then that carries with it some “bigger” changes. Laravel 10, like the last couple of versions, has been an exercise in an elegant release structure that enables developers to upgrade and deploy an app, usually in less than 10 minutes. I’ve been able to get a couple applications upgraded recently, and it took less than 5 minutes in each case. There are a few small quirks in version 10’s upgrade process, which are outlined below. However, the overall upgrade is smooth and, in this version’s case, simply adds more features and a minor reduction in dependencies. by Matt Lantz

PSR Pickup: PSR-17: HTTP Factories

By Frank Wallen

In PHPArchitect Issue 7 of Volume 21 (way back in July 2022), I wrote about PSR-7: Message Interfaces, where Request and Response interfaces were defined to ensure that requests and responses were properly structured and handled. PSR-17 was created to support PSR-7 by defining interfaces for factories to create HTTP objects. The factory design pattern is an excellent way to introduce standards in components not specifically implementing PSR-7 interfaces. They will produce the request and response objects following the recommended standards, and the implementing code will not require a major refactor. PSR-7 was written before the release of PHP 7; therefore, following these recommended standards is important for security and stability. by Frank Wallen

finally{}: Nothing Lasts Longer

By Beth Tucker Long

The system needs a new feature, but we will need to do a lot of refactoring or rewriting to get it done. Someone proposes a quick workaround to get it working while we wait to get the rest of the proper work done. “What? We can’t do that”, someone responds. “We have to do this the right way.” by Beth Tucker Long

Leave a comment

Use the form below to leave a comment: