Entwicklerblog

Entwickler haben oft Meinungen.. lesen Sie meine hier

Handle download of large files when memory limit is tight

Just today I had a situation where I wanted to make a large ZIP file available to download, but the host has a memory limit that I cannot change. However, memory should never be a problem in modern applications. In this case however, my code caused an exhaust of the RAM and thus, aborted the process when the requested ZIP file was too large. Boom: Fatal Error: Allowed Memory Size of 134217728 Byt…

Super Simple Symfony Docker Creator released and ready to be used (beginner friendly)

When I board-on new clients I usually need a docker environment. It used to be aligned with Magento 1 and 2. Now, I moved on and said Goodbye to focus for Magento 1 and 2 clients and now I am working much more with Symfony. That said, new clients usually get a Symfony-based solution. And because of that, I need an individual docker environment everytime a new client hops on. My demand for my serv…

Run Magento 2.4 without ElasticSearch stack and with MySQL Legacy search

Today we learned about a nice module that can help vendors to get rid of one of the most controversial decisions made by Adobe in the context of Magento 2: the ElasticSearch component. But what is ElasticSearch and why do Magento2 shops even need it in the first place? To understand this, we must take a look how Magento has evolved over the course of the last 10 years. First, there were Mage…

Using the Entity Manager in Symfony: Why It's a Bad Idea

The persistence of entities in a database is managed by the entity manager in Symfony. Entities may be added to, changed, removed, and retrieved from the database. It might be a bad decision to use the entity manager in your application, regardless how convenient it is. This article will explain why using explicit entity repositories rather than the entity manager is typically seen to be a prefer…

Why is working with objects generally faster (and better!) than arrays in PHP

In general, working with objects in PHP can be faster than working with arrays because objects are more predictable in terms of memory usage and performance. This is because objects have a fixed number of properties, while arrays can grow dynamically and potentially use more memory as a result.To understand why this is the case, it's helpful to understand how PHP handles objects and arrays under…

Why API Platform is the Best Tool for Building APIs with Symfony (quickly!)

If you're a PHP developer looking to build APIs with Symfony, you may have considered using API Platform as your go-to tool. In this article, we'll discuss why API Platform is the best choice for building APIs with Symfony, and why it is better than other alternatives.1. API Platform is built on top of SymfonyOne of the main reasons to use API Platform is that it is built on top of Symfony, one o…

Why You Should Avoid Static Methods in PHP

As a PHP developer, you may have encountered static methods in your code before. These are methods that are defined as static and can be called directly on a class, rather than on an instance of the class.While static methods can be convenient in some situations, they are generally considered to be a bad practice in object-oriented programming (OOP). In this article, we'll discuss why you should…

Why canonical URLs are important for your SEO ranking

What is a canonical tag?A canonical tag (also known as "rel canonical") is a way of communicating to search engines that a specific URL is the master copy of a page. Using the canonical tag avoids the problems caused by displaying identical or "duplicate" content on multiple URLs. In practical terms, the canonical tag tells search engines which version of a URL you want to show up in search resul…

PHP Static Analysis during development to avoid bugs in code

Developers are a special kind of thinkers. Non-coders on the other hand side assume often, that coding is either black magic or "very simple". Every developer knows the phrase "just change this and that" from someone that has heard about SQL at some point during their career and now they believe they understand a developers work better than the literal developer. And static analysis is something…

Why you should use final and abstract classes with Interfaces attached to them in PHP

Ever stumbled upon a PHP file that has the keyword `final` sitting in front of its class declaration and wonder what its doing? Today we want to shed some light on it and also talk about something that many developers don't do yet, but should (and why). In addition to the standard terms that are almost always used in inheritance - for example, `extends` or `parent::something()` - there are s…

Magento1 Performance aspects when working with entities

Hello,today we want to talk a little bit about how Magento 1 Shops can even today in 2022 be improved. As of October 2022, there are over 167000 active eCommerce sites running Magento 1 and nearly 100,000 running Magento 2, representing approximately 0.9% of all online shops. This is just one of the Magento usage statistics that cement it as a major player in the eCommerce industry. Well, now we…

PHP 7.4 deprecation, upgrade to PHP 8.x now!

Hello,today we want to talk a little bit about PHP 7.4 and why clients should upgrade to PHP 8.x as soon as possible. Many companies are still running on outdated PHP versions, even PHP 5.6 or lower. To people who are unaware of what PHP even is, have the PHP officials explanation for it: PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely used and generally intended open source s…

Composer Webroot installer for PHP8.1

Hello everyone, lately, the PHP community goes crazy because of the upcoming deprecation and discontinuation of PHP7.4. Many vendors aren't ready to upgrade to PHP8.1 and some work most be done in order to be able to upgrade without an issue. So did one of our clients.We had to upgrade from a composer setup that was working with PHP7.4 to PHP8.1, but it wasn't so easy to do. The system is a relat…