PHP / Magento Dev Blog

  • Home

Design patterns – introduction, 23 GoF patterns table, when to use and when not to

  • 0
Henryk Tews
Tuesday, 03 May 2022 / Published in Wzorce projektowe

Design patterns are reusable solutions to recurring design problems. The Gang of Four book from 1994 catalogued 23 patterns split into three categories. They are not code snippets to paste in – they are a vocabulary for communicating design decisions. This post is an introduction and reference table before I cover each pattern individually in the coming weeks.

(more…)

SOLID principles in PHP – theory into code

  • 0
Henryk Tews
Tuesday, 12 April 2022 / Published in PHP

SOLID principles are five design guidelines that make object-oriented code maintainable, extensible, and testable. They are not rules to be applied mechanically but tools for reasoning about design decisions. I show each principle in PHP with a before/after example and a concrete connection to Magento 2 architecture.

(more…)

PHP 8.1 in practice – enums after a month, database storage, Money value object

  • 0
Henryk Tews
Tuesday, 08 March 2022 / Published in PHP

PHP 8.1 was released in November 2021. After a month of migrating modules and writing new code with the new features I have a clear view of what matters in practice. Enums are the biggest quality-of-life improvement – I show how I store them in the database, use them in match expressions, and build a Money value object that shows readonly properties and enums working together.

(more…)

Chain of Responsibility – validator chain, di.xml configuration with sortOrder

  • 0
Henryk Tews
Tuesday, 08 February 2022 / Published in Wzorce projektowe

Chain of Responsibility passes a request along a chain of handlers. Each handler decides whether to process it or pass it on. The pattern is perfect for multi-step validation, middleware pipelines, and request processing where the set of handlers needs to change without modifying callers. I build a validator chain in PHP and show how to configure handler order through Magento 2 di.xml.

(more…)

Redis in Magento 2 – three roles, env.php configuration, separate instances, monitoring

  • 0
Henryk Tews
Tuesday, 11 January 2022 / Published in Magento / Adobe Commerce

Redis in Magento 2 is not a single thing – it serves three distinct roles that should ideally run as separate instances with different configurations. Object cache, Full Page Cache, and session storage have very different access patterns and eviction requirements. I show how to configure each, why separate instances matter, and how to monitor what is happening.

(more…)

Dynamic programming – memoization, knapsack, LCS, memoize decorator

  • 0
Henryk Tews
Tuesday, 07 December 2021 / Published in Algorytmy

Dynamic programming is one of those techniques that sounds intimidating but is built on one simple idea: remember results you have already computed so you do not compute them again. Memoization, the knapsack problem, Longest Common Subsequence – I implement them all in PHP and show a reusable memoize decorator that works with any callable.

(more…)

PHP 8.1 preview – enums, readonly properties, intersection types, Fibers

  • 0
Henryk Tews
Tuesday, 09 November 2021 / Published in PHP

PHP 8.1 is due in November 2021 and brings the most significant type system additions since PHP 7.0. Enums solve a problem we have been working around with class constants for years. Readonly properties close the final gap in immutable value objects. Intersection types complete the union types from PHP 8.0. Fibers introduce cooperative multitasking. I go through each with practical examples.

(more…)

PimCore – CMS + PIM + DAM, object classes, Data Hub GraphQL, Magento integration

  • 0
Henryk Tews
Tuesday, 12 October 2021 / Published in PHP, PIM

PimCore is an open-source platform that combines CMS, PIM, DAM and e-commerce capabilities in one system. It is less known than Akeneo in PIM circles but offers something Akeneo does not: a full content management layer alongside product data. I show the architecture, object classes that define the data model, the Data Hub GraphQL API, and integration with Magento 2.

(more…)

GitHub Actions – PHP pipeline, test matrix, staging deploy via SSH

  • 0
Henryk Tews
Tuesday, 14 September 2021 / Published in Środowiska

GitHub Actions turned CI/CD from a DevOps speciality into something any developer can set up in an afternoon. For PHP projects it means automatic test runs, static analysis, and deployment to staging on every pull request – without maintaining a Jenkins server. I show a practical pipeline for a PHP/Magento project with a test matrix and SSH deployment.

(more…)

Proxy pattern – lazy loading, access control, caching, Proxy in Magento 2

  • 0
Henryk Tews
Tuesday, 10 August 2021 / Published in Magento / Adobe Commerce, Wzorce projektowe

Proxy is a structural pattern that places a surrogate in front of an object to control access to it. Three practical scenarios justify Proxy: lazy loading (deferring expensive creation), access control (checking permissions before executing), and caching. Magento 2 generates Proxy classes automatically for a specific purpose – I show both the GoF pattern and the Magento implementation.

(more…)

  • 14
  • 15
  • 16
  • 17
  • 18

© 2026 Created by

TOP
Zarządzaj zgodą
Aby zapewnić jak najlepsze wrażenia, korzystamy z technologii, takich jak pliki cookie, do przechowywania i/lub uzyskiwania dostępu do informacji o urządzeniu. Zgoda na te technologie pozwoli nam przetwarzać dane, takie jak zachowanie podczas przeglądania lub unikalne identyfikatory na tej stronie. Brak wyrażenia zgody lub wycofanie zgody może niekorzystnie wpłynąć na niektóre cechy i funkcje.
Funkcjonalne Always active
Przechowywanie lub dostęp do danych technicznych jest ściśle konieczny do uzasadnionego celu umożliwienia korzystania z konkretnej usługi wyraźnie żądanej przez subskrybenta lub użytkownika, lub wyłącznie w celu przeprowadzenia transmisji komunikatu przez sieć łączności elektronicznej.
Preferencje
Przechowywanie lub dostęp techniczny jest niezbędny do uzasadnionego celu przechowywania preferencji, o które nie prosi subskrybent lub użytkownik.
Statystyka
Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do celów statystycznych. Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do anonimowych celów statystycznych. Bez wezwania do sądu, dobrowolnego podporządkowania się dostawcy usług internetowych lub dodatkowych zapisów od strony trzeciej, informacje przechowywane lub pobierane wyłącznie w tym celu zwykle nie mogą być wykorzystywane do identyfikacji użytkownika.
Marketing
Przechowywanie lub dostęp techniczny jest wymagany do tworzenia profili użytkowników w celu wysyłania reklam lub śledzenia użytkownika na stronie internetowej lub na kilku stronach internetowych w podobnych celach marketingowych.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Zobacz preferencje
  • {title}
  • {title}
  • {title}