OpenLampTech No. 141
Long-running MySQL queries | PHP array typing | WP JSON schema | PHP magic constants | MySQL 9.x release(s) | WooCommerce 2024 roadmap update.
Thank you for reading the OpenLampTech newsletter!
If someone awesome shared this newsletter with you and you are not yet subscribed, please use the Subscribe button below and join:
OpenLampTech has sponsorship opportunities for your brand, product, or service in the weekly newsletter. As an independent publication, collaboration is very affordable.
All commentary is mine unless otherwise quoted.
Why you should be typing your arrays in PHP
This post shares some of the benefits of typed arrays in PHP.
Here is a quick summary of what I learned:
Autocompletion in an IDE.
Provide specific errors with static analysis tooling.
Future self (and other developers) understanding.
Additional (advanced) considerations with PHP arrays are that you can specify them as list types, to have specific keys (and types), or that the array should be non-empty.
No MySQL 9.x Innovation Releases from Percona
MySQL is releasing innovation releases for versions 9.1.0 to 9.6.0. This series only provides short-term support but will have an LTS (v9.7) eventually.
Using these short-term support releases may not be ideal for mission-critical applications as they are more focused on innovation.
[Percona]
JavaScript Object Notation or JSON, has always been an important (and integral) data format structure. With the direction WordPress is headed, JSON is even more important with many block (and other) configurations using the language.
Quoted directly from the source article, JSON Schema is defined as:
“JSON Schema is a contract between those who create the data and those who use it, making it easy to understand the data structure and automatically check that the JSON content is correct.”
[WordPress Developer Blog]
[Affiliate]
Consuming APIs in Laravel - Learn how to confidently integrate third-party APIs in your Laravel projects using maintainable, testable, and extensible code.
Deleted a table in production and lost four more table data with ON DELETE CASCADE
When ON DELETE CASCADE is part of a table's schema definition, child rows are deleted along with the parent row due to the FOREIGN KEY definition.
This can be both useful and a bane.
Useful in that you remove any orphaned rows from the database.
A bane in that additional table's rows are deleted too. Which may be unexpected or unforeseen, resulting in bugs further down the application’s life cycle.
[dev.to]
In this article, Ash Allen visits all 9 PHP magic constants, providing context using code examples and explaining what each does.
I've not personally used all of these magic constants in my PHP development career. I can see where many of them would be useful in specific use cases.
Out of all 9 magic constants, __FILE__ is the one I've used most.
(Be sure to check out Ash Allen's book, Consuming APIs In Laravel, if you want to take your Laravel development skills to the next level. [affiliate])
[Ash Allen Design]
Introducing Built with Laravel
Laravel is one of (if not the) most popular PHP frameworks. Laravel also has a large, active community behind it.
It should be no surprise that there are applications and websites galore created with Laravel.
Built with Laravel, is a website showcasing companies who are using Laravel for their web applications.
This is a great resource for Laravel developers, providing real-world use cases as to why Laravel can be a solid option, despite the bad stigma PHP still receives to this day.
[Laravel News]
Managing Long-Running Queries in MySQL
Long-running queries can be a big bottleneck in a web application’s performance.
When MySQL queries take longer to run than normal, you may have one of these types of queries.
If you're unsure about how to properly tune your MySQL database for optimum performance, have no worries.
Roman Agabekov of Releem shares some tips on troubleshooting and tuning long-running MySQL queries.
[Releem]
WooCommerce news and updates
WooCommerce in 2024 and beyond: Roadmap update (July 23rd, 2024)
[#Affiliates and Classifieds] - Your support keeps the OpenLampTech newsletter free for readers
Ultimate Laravel Boilerplate to help other indie hackers deliver their SaaS in hours. Get started with LaraFast today! (affiliate)
Popups, newsletters, and abandoned carts. Use Omnisend with integrated email and SMS campaigns. (affiliate)
Thank you for reading. I hope you have a great rest of your week.
Take care.
Josh Otwell
Some links may be affiliate links from which I earn a small commission at no additional cost to you.


