Skip to content

Instantly share code, notes, and snippets.

The next step…

Michelangelo van Dam DragonBe

The next step…
View GitHub Profile
DragonBe / Product.php
Created Mar 28, 2014
Example usage for ArrayAccess interface
View Product.php
class Product implements ArrayAccess
protected $_productId;
protected $_title;
protected $_price;
protected $_arrayAccess;
public function __construct($data = null)
DragonBe / FinalClass.php
Created Jul 20, 2017
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
View FinalClass.php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
protected $bar;
DragonBe /
Last active Oct 13, 2020
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

DragonBe / Vagrantfile-php7.2
Created Mar 20, 2018
A quick Vagrant file to get started with PHP 7.2
View Vagrantfile-php7.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
@script = <<SCRIPT
# Fix for
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo " ubuntu-xenial" >> /etc/hosts
DragonBe / WooCommerce Plugin Privacy Checker
Created May 10, 2020
Here's a step-by-step process to check if a WooCommerce plugin adopts the privacy functionality provided by the platform by extending WC_Abstract_Privacy.
View WooCommerce Plugin Privacy Checker

Plugins checker

This is a small report about plugins I've verified with phpdoc for extending WC_Abstract_Privacy privacy class provided by WooCommerce.

Based on information found in WooCommerce Guidelines for GDPR, Making Woo Extensions GDPR compliant and the whole WC_Abstract_Privacy class API.

Plugins not extending the privacy class

DragonBe /
Created Aug 9, 2016
Simple test for PHP development skill evaluation (orig. created by Mikko Koppanen)

The assignment (max 1h30): Salary Payment Date tool

This assignment gives us a good understanding about the thought-process and the capabilities of the developer. This doesn’t have to be a rock-solid, highly scalable super fancy production-ready application, but just something that allows us to get an idea of the developer's skills and level.

Try to keep things simple. If frameworks, libraries or databases are needed to write the application, please mention them and the arguments why they were required in the documentation for this assignment.

NOTE: This is a sample code and will only be used for evaluation purposes


DragonBe / Vagrantfile-php7.3
Created Oct 8, 2019
Quickly set up a Vagrantbox with Debian 8 and PHP 7.3
View Vagrantfile-php7.3
Vagrant.configure("2") do |config| = "debian/jessie64"
config.vm.hostname = "jenkins-php7" "private_network", ip: ""
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provision "shell", inline: <<-SCRIPT
apt-get update
apt-get upgrade -y
apt-get install -y \
ca-certificates \
DragonBe / Vagrantfile
Created Jan 19, 2018
A quick-and-simple VM with PHP 7.2
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "debian/jessie64"
config.vm.host_name = "phpvm"
config.vm.box_check_update = false "private_network", ip: ""
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
DragonBe / Vagrantfile
Last active Oct 7, 2019
Quickly run PHP 7.2, MySQL 5.7 and Nginx 1.14 within Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.require_version ">= 2.2.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vagrant.plugins = ["vagrant-vbguest"]
You can’t perform that action at this time.