WordPress and docker setup
Below commands will setup WordPress, MySQL & PHPMyAdmin with a single command. Add the code below to “docker-compose.yaml” and run the command
WordPress and docker setup Read More »
Below commands will setup WordPress, MySQL & PHPMyAdmin with a single command. Add the code below to “docker-compose.yaml” and run the command
WordPress and docker setup Read More »
Show commands & management commands Docker version info Show info like number of containers, etc WORKING WITH CONTAINERS Create an run a container in foreground Create an run a container in background Shorthand Naming Containers TIP: WHAT RUN DID Looked for image called nginx in image cache If not found in cache, it looks to
Chain-of-responsibility pattern The chain-of-responsibility pattern is a behavioral design pattern consisting of a source of command objects and a series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain. A mechanism also exists
Design Patterns in PHP – Chain-of-responsibility pattern Read More »
Observer pattern The observer pattern is a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used for implementing distributed event handling systems, in “event driven” software. In
Design Patterns in PHP – Observer pattern Read More »
Strategy pattern The strategy pattern (also known as the policy pattern) is a behavioral software design pattern that enables selecting an algorithm at runtime. Instead of implementing a single algorithm directly, code receives run-time instructions as to which in a family of algorithms to use. Strategy lets the algorithm vary independently from clients that use
Design Patterns in PHP – Strategy pattern Read More »
Template method pattern The template method is a method in a superclass, usually an abstract superclass, and defines the skeleton of an operation in terms of a number of high-level steps. These steps are themselves implemented by additional helper methods in the same class as the template method. The helper methods may be either abstract
Design Patterns in PHP – Template method pattern Read More »
Adapter design pattern The adapter pattern is a software design pattern (also known as wrapper, an alternative naming shared with the decorator pattern) that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code. An example
Design Patterns in PHP – Adapter design pattern Read More »
The Decorator Pattern, Adapter Pattern, Template Method Pattern, Strategy Pattern, Observer Pattern Decorator design pattern In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class. The decorator pattern is often useful for adhering
Design Patterns in PHP – Decorator design pattern Read More »
Insert an associtive array ain another assoInsert an associative array in another associative array array_splice() or array_merge() php functions doesn’t preserve keys. So if we use these functions then new array key will be [0]Instead we will use array_splice() and use ‘+’ to concatenate the arrays
How to preserve array keys for an associative array in php Read More »
Add an array in the middle on another associative array in php
Add an array in the middle on another associative array in php Read More »