Skip to content

Instantly share code, notes, and snippets.

@harlesc
harlesc / 0_reuse_code.js
Created November 11, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@harlesc
harlesc / Dockerfile
Last active March 14, 2017 13:03
Docker + PHP 7.0.0RC6 + xdebug + docker-spy for Magento 1.9 development
# Charles Hilditch <[email protected]>
# Tested on Magento 1.9.2.2 with MageMechanic_PhpSeven module installed for PHP7 compatibility.
# https://github.com/MageMechanic/PhpSeven
FROM php:7-apache
RUN apt-get update && apt-get install -y vim libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev mlocate
RUN chown -R www-data:www-data /var/www/html
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/lib/x86_64-linux-gnu
RUN docker-php-ext-install gd mysqli pdo pdo_mysql mcrypt intl
RUN cp /usr/src/php/php.ini-development /usr/local/etc/php/php.ini && sed -i.bak 's/\;error_log = php_errors.log/error_log = \/var\/log\/php_errors.log/' /usr/local/etc/php/php.ini && touch /var/log/php_errors.log
RUN a2enmod rewrite && apachectl restart
@harlesc
harlesc / PHP7 Magento 1.9 core patch.md
Last active April 9, 2017 20:31
Patch to get Magento 1.9 working with >= PHP 7.0.0 RC 6

Patch using method below or if you don't want to patch a core file, see this Magento extension that does the same thing but correctly overrides the core file:
https://github.com/MageMechanic/PhpSeven

# run in magento root directory

# one-liner to apply patch using wget
wget -qO- 'https://gist.githubusercontent.com/MageMechanic/66449504110fbbd96214/raw/php7_magento_1_9_core.patch' | patch -p0

# one-liner to apply patch using curl