PHP / Magento Dev Blog

  • Publikacje
  • O autorze
  • Kontakt

Docker from scratch – Dockerfile, nginx, docker-compose, Xdebug 3.x

  • 0
Henryk Tews
Tuesday, 07 April 2020 / Published in Środowiska

DDEV works great day to day, but what if you need a custom configuration DDEV does not support? Or you want to understand what is happening under the hood? I show how to build a PHP environment from scratch with pure Docker and docker-compose – nginx, PHP-FPM, MySQL and Redis with no intermediate tools.

(more…)

Doubly linked list – implementation from scratch, SplDoublyLinkedList, comparison table

  • 0
Henryk Tews
Tuesday, 10 March 2020 / Published in Algorytmy

PHP array is versatile enough that we rarely need other data structures. But a doubly linked list has properties an array does not – inserting and removing elements from the middle in O(1), without shifting the remaining elements. I implement one from scratch in PHP and show when it is worth reaching for.

(more…)

GraphQL in Magento 2 – custom resolver, schema, authorization, testing in DDEV

  • 0
Henryk Tews
Tuesday, 11 February 2020 / Published in Magento 2

Magento 2.3 introduced GraphQL as an alternative to the REST API. Where REST requires separate endpoints for each resource, GraphQL lets the client decide what data it needs in a single query. I show how to write a custom resolver and expose data through GraphQL in a Magento 2 module.

(more…)

PHP 7.4 in practice – typed properties pitfalls, hydration, PHP 8.0 preview

  • 0
Henryk Tews
Monday, 13 January 2020 / Published in PHP

PHP 7.4 was released in November 2019. After migrating several Magento 2 modules to the new version I have a clear picture. Typed properties genuinely affect the way you write classes – but they also have pitfalls worth knowing. I show what works great, what surprises you, and what migration looks like in practice.

(more…)

Factory Method – Simple Factory, GoF, auto-generated factories in Magento 2

  • 0
Henryk Tews
Tuesday, 10 December 2019 / Published in Wzorce projektowe

The new operator in production code is a warning sign. A class that directly instantiates other classes is tightly coupled to them – hard to test, hard to extend. Factory Method delegates the responsibility for object creation to dedicated classes. In Magento 2 factories are everywhere – and generated automatically.

(more…)

Message Queue Framework with RabbitMQ – publisher, consumer, DDEV config

  • 0
Henryk Tews
Tuesday, 12 November 2019 / Published in Magento 2

Operations like sending emails, syncing with an ERP, or recalculating indexes do not have to block an HTTP request. Magento 2 has a built-in Message Queue Framework that lets you push such tasks to an asynchronous queue. I show how it works with RabbitMQ and how to write your own publisher and consumer.

(more…)

Hash table in PHP – in_array vs isset, SplQueue, SplFixedArray

  • 0
Henryk Tews
Tuesday, 08 October 2019 / Published in Algorytmy

A PHP array is one of the most-used data types, but few people think about how it works under the hood. A PHP array is actually a hash table – a data structure that allows O(1) element access. I show how it works, what the practical implications are, and where PHP arrays surprise you with their performance characteristics.

(more…)

PHP 7.4 preview – typed properties, arrow functions, spread in arrays, preloading

  • 0
Henryk Tews
Tuesday, 10 September 2019 / Published in PHP

PHP 7.4 arrives in November 2019 and brings several changes that will have a real impact on everyday code. Typed properties are the headline feature – at last we can declare types directly on class properties. Plus arrow functions, spread in arrays, and the null coalescing assignment operator.

(more…)

Decorator pattern in PHP – composition over inheritance, cached repository example

  • 0
Henryk Tews
Tuesday, 13 August 2019 / Published in Wzorce projektowe

Inheritance is the simplest way to extend a class – but not always the best. When you want to add several independent features to an object, a class hierarchy quickly becomes unreadable. Decorator lets you wrap objects in layers of functionality without modifying the original and without deep inheritance.

(more…)

DI in Magento 2 – container, Virtual Types, Factory, shared/non-shared

  • 0
Henryk Tews
Tuesday, 09 July 2019 / Published in Magento 2

Dependency Injection in Magento 2 looks like magic at first. You type an interface in the constructor and Magento delivers the right implementation. How does it know what to inject? How does DI compilation work? What are virtual types and what are they for? I break it all down.

(more…)

  • 10
  • 11
  • 12
  • 13
  • 14

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