Skip to content

Instantly share code, notes, and snippets.

@phptuts
phptuts / drupal-installation.md
Last active March 15, 2020 02:49
Installing Drupal With land
lando poweroff
rm -rf yoursitename && mkdir -p yoursitename && cd yoursitename
lando init --source remote --remote-url https://www.drupal.org/download-latest/tar.gz --remote-options="--strip-components 1" --recipe drupal8 --webroot . --name yoursitename
lando start

Data Information

database name: yoursitename

@phptuts
phptuts / index.php
Created February 18, 2019 03:43
Observer Pattern
<?php
interface Subject {
public function attach(Observable $observable);
public function detach(Observable $observable);
public function next($value);
}
@phptuts
phptuts / index.php
Created February 17, 2019 23:38
Chain of Responsibility Pattern
<?php
abstract class RoleChecker {
/**
* @var RoleChecker
*/
protected $nextCheck;
abstract public function check(UserRole $userRole);
@phptuts
phptuts / index.php
Created February 17, 2019 02:22
Strategy Design Patter
<?php
interface Message {
public function send($event);
}
class Mail implements Message {
public function send($event)
@phptuts
phptuts / index.php
Created February 17, 2019 02:03
Template Design Pattern
<?php
abstract class Gratitude {
protected $reporter;
protected $date;
@phptuts
phptuts / index.php
Created February 15, 2019 05:04
PHP Decorator Pattern
<?php
interface FilterNumber {
/**
* @return @array
*/
public function filter();
}
@phptuts
phptuts / index.php
Created February 15, 2019 05:00
PHP Adapter Pattern
<?php
class AuthSystem {
/**
* @var EmailLoginInterface
*/
private $login;
public function __construct(EmailLoginInterface $login)