Skip to content

Instantly share code, notes, and snippets.

View ProcessEight's full-sized avatar
💻
Working remotely

Simon Frost ProcessEight

💻
Working remotely
  • York
View GitHub Profile
@ProcessEight
ProcessEight / install-magento1-with-sample-data.sh
Created April 18, 2017 17:40
Install Magento 1 with sample data through Composer
#!/usr/bin/env bash
# Install Magento sample data from pre-existing archive
# Just find and replace version number
# Run this from the projectroot of the vhost (usually folder with www and logs in it)
#
# What it does:
#
# 1. Copy media folder into current folder
# 2. Copy skin folder into current folder
# 3. Copy local.xml into app/etc ready for editing
@ProcessEight
ProcessEight / Magento 1 stack configs.md
Last active April 21, 2018 04:24
Sample config files for the Magento 1 LEMP stack

Magento 1 stack configs

Nginx

nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;
@ProcessEight
ProcessEight / Debug API requests.md
Last active January 18, 2021 13:20
Example scripts showing how to debug API calls with Xdebug

Debugging with Xdebug

Debug from the command line in Xdebug

Just export the XDEBUG_CONFIG variable:

export XDEBUG_CONFIG="idekey=PHPSTORM"

Remember to enable Xdebug first:

@ProcessEight
ProcessEight / Download any Magento version or patch programmatically.md
Created July 31, 2017 10:33
Download any Magento resource programmatically.md

Download any Magento version or patch programmatically

  1. Login to Magento.com and find your account ID.
  2. Go to Account Settings > Downloads Access Token and generate a new token.
  3. cURL (or wget) the following URL to make sure you can authenticate: https://MAG_ID:[email protected]/products/downloads/info/help

Example:

$ curl -k https://MAG_ID:[email protected]/products/downloads/info/help
@ProcessEight
ProcessEight / Enabling-and-disabling-Xdebug.md
Last active November 25, 2021 11:00
How to enable and disable smoothly using simple bash scripts

Enabling and disabling the Xdebug PHP extension with a single command

Note: This guide assumes you are using PHP-FPM and Ubuntu 16.04

Speed (and therefore time) is of the essence

Xdebug is a fantastic tool which can save hours or even days of debugging effort.

Yet just enabling the extension itself will slow down Magento. Composer will also warn you of performance degradation when running it with Xdebug enabled.

@ProcessEight
ProcessEight / Mage Titans Presentations 2018.md
Last active February 12, 2019 15:06
Mage Titans Presentations 2018

Mage Titans Presentations

Async PHP

  • Basic concepts of asynchronous programming
  • Using it to process queues
  • Any other angles?

In this talk, I'll discuss how to appply asynchronous programming techniques to solve common problems in Magento.

After a quick introduction to the basics of asynchronous programming, I'll show you how frameworks like ReactPHP and AmPHP can take PHP beyond the traditional 'run the script, execute some code and die' paradigm and demonstrate some novel and unique ways that asynchronous programming can be used in your Magento store.

@ProcessEight
ProcessEight / Anatomy of Magento 2: Layered Navigation.md
Last active October 23, 2025 11:05
In-depth exploration of how layered navigation is implemented in Magento 2

Anatomy of Magento 2: Layered Navigation

Points for investigation

  • Generate high-level overview of all the main components
  • How are the total item counts for each option generated?
  • How is the catalog updated to display the matching products?
  • How are options rendered?
  • What are the customisation points?
  • What events are dispatched?
@ProcessEight
ProcessEight / Applying SUPEEs to Magento - a checklist.md
Created April 12, 2019 14:04
Applying SUPEEs to Magento - a checklist
  • (/) Check the patch release notes for any dependencies. Some patches need to have other patches applied/reverted before they can be applied successfully
  • (/) Check if earlier patches need to be reverted and a newer version installed first
  • (/) Download patch
  • (/) Make it executable
  • (/) Run patch helper
  • (/) Apply patch
  • (/) Move the patch file to /app/etc/patches
  • (/) Manually add files created by the patch to git
  • (/) Commit the patch changes before manually merging any changes
@ProcessEight
ProcessEight / laravel-troubleshooting.md
Last active May 23, 2024 16:55
Troubleshooting common Laravel problems

Laravel Troubleshooting

Logging

PHP Fatal error: Uncaught Error: Class "Monolog\Logger" not found in ./vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:60

This occurred because the PHP PSR extension php8.3-psr was enabled, but is apparently 'broken' (see Seldaek/monolog#1876 (comment)). Disabling the extension fixed the problem.

If that's not it, then try these steps:

@ProcessEight
ProcessEight / debugging-podcast-notes.md
Created May 3, 2021 14:05
Notes for the Swift Otter 'Smash the bug' podcast

Notes for Swift Otter podcast

Shortcuts

  • Power user tip: If the error message or error description sounds familiar, check your list of previous solutions, before you spend hours debugging.
  • Otherwise, start gathering evidence:
    • From error logs, error messages, unusual behaviour, entities with missing information (e.g. Orders, customers, products)
    • Reproducibility: If it can't be reproduced, it'll be hard, if not impossible to debug. Wait for it to occur regularly before investing time in debugging it.

First level (i.e. Can we get away with an quick/easy win?)