PHP / Magento Dev Blog

  • Publikacje
  • O autorze
  • Kontakt

Magento 2 performance – OPcache, Redis, N+1 queries, Blackfire, priority table

  • 0
Henryk Tews
Tuesday, 14 February 2023 / Published in Magento 2

Magento 2 performance is a broad topic, but the high-impact improvements follow a clear priority order. OPcache configuration is free and immediate. Redis correctly configured reduces PHP cycles. N+1 queries are the single biggest source of slowness in custom code. Blackfire makes the invisible visible. I show a prioritised approach with concrete configurations and code examples.

(more…)

TypeScript for the PHP developer – types, interfaces, generics, async/await

  • 0
Henryk Tews
Tuesday, 10 January 2023 / Published in JavaScript

TypeScript is to JavaScript what strict_types + PHPStan is to PHP – it adds a type system on top of a dynamically typed language and catches errors before runtime. For a PHP developer the concepts are familiar: interfaces, generics, union types. I show the most important TypeScript features from the perspective of someone who thinks in typed PHP daily.

(more…)

PHP 8.2 – readonly classes in practice, deprecations, Rector, migration checklist

  • 0
Henryk Tews
Tuesday, 13 December 2022 / Published in PHP

PHP 8.2 was officially released on 8 December 2022. A month of using readonly classes in new modules and patching dynamic properties in older code gives a clear practical picture. I show what readonly classes look like in real Magento 2 code, the most common dynamic property violations and how to fix them with Rector, and a migration checklist for upgrading existing projects.

(more…)

Template Method – algorithm skeleton, hooks, abstract vs hook, comparison with Strategy

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

Template Method defines the skeleton of an algorithm in a base class and lets subclasses fill in specific steps. It is the backbone of inheritance-based extensibility – and one of the most widely used patterns in frameworks like Magento 2, Symfony and Laravel. I show the classic GoF implementation, the difference between abstract steps and hooks, and a comparison with Strategy.

(more…)

MSI – Source, Stock, SSA, custom algorithm, migrating from legacy API

  • 0
Henryk Tews
Tuesday, 11 October 2022 / Published in Magento 2

Multi Source Inventory replaced the old single-stock Magento inventory system. MSI introduces Sources (physical locations), Stocks (virtual aggregations), and Source Selection Algorithms (how to fulfil orders). Most shops use only default configurations, but once you have multiple warehouses or need custom fulfilment logic, MSI requires deep understanding. I show the architecture and how to write a custom SSA.

(more…)

Quicksort – variants, Introsort, benchmark vs native sort()

  • 0
Henryk Tews
Tuesday, 13 September 2022 / Published in Algorytmy

Quicksort is the most widely used sorting algorithm in practice – it is the basis of PHP’s built-in sort(), most standard library implementations, and many database engines. I show the classic recursive implementation, the three-way partition variant for arrays with many duplicates, and benchmark it against PHP’s native sort() and usort() to see when writing your own makes any sense at all.

(more…)

Custom payment method – authorize/capture/refund, JS renderer, PCI DSS

  • 0
Henryk Tews
Tuesday, 09 August 2022 / Published in Magento 2

Building a custom payment method in Magento 2 is one of the more complex integrations you can do on the platform. It touches frontend JavaScript, backend PHP, REST API configuration, and security requirements. I walk through the complete implementation – authorize, capture, refund, the JS renderer for checkout, and PCI DSS considerations.

(more…)

PHP 8.2 preview – readonly classes, DNF types, dynamic properties deprecated

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

PHP 8.2 arrives in November 2022 and its headline features are more conservative than 8.0 or 8.1, but each one plugs a real gap in the type system. Readonly classes eliminate boilerplate in immutable DTOs. DNF types allow complex type expressions that were impossible before. Deprecating dynamic properties starts enforcing something good OOP practice demanded for years.

(more…)

GoF patterns in Magento 2 – where to find them and how they work

  • 0
Henryk Tews
Tuesday, 21 June 2022 / Published in Magento 2, Wzorce projektowe

After covering all 23 GoF patterns individually, time to see where they actually live inside Magento 2. The platform is a textbook example of design patterns applied at scale – DI, plugins, observers, repositories, factories all map directly to specific GoF patterns. This post is a guided tour of patterns hiding in plain sight in Magento’s architecture.

(more…)

Command and Chain of Responsibility in PHP – behavioural patterns

  • 0
Henryk Tews
Tuesday, 14 June 2022 / Published in Wzorce projektowe

Command and Chain of Responsibility are two behavioural patterns that both deal with processing requests – but from different angles. Command encapsulates a request as an object, enabling undo, queuing, and logging. Chain of Responsibility passes the request along a handler chain until one processes it. I show GoF implementations and their natural fit in Magento 2.

(more…)

  • 6
  • 7
  • 8
  • 9
  • 10

© 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}