Skip to content

Instantly share code, notes, and snippets.

View freestream's full-sized avatar

Anton Samuelsson freestream

View GitHub Profile
@freestream
freestream / magento2-bootstrap.php
Last active April 28, 2020 11:27
Bootstrap Magento 2
<?php
/**
*
* This script will load the Magento 2 Object Manager, after which you
* can execute anything you want. "One time" scripts, just to fool
* around with Magento's functionality or to debug stuff.
*
* Place this file in the root folder of the Magento instance and execute:
* php magento2-bootstrap.php
@freestream
freestream / magento2-install-sample-data
Last active September 7, 2015 06:30
Install Magento2 Sample Data
Update composer.json and add following:
{
...
"require": {
"magento/framework": "~1.0.0-beta",
"magento/sample-data": "1.0.0-beta",
"magento/sample-data-media": "~0.42.0-beta2"
},
"repositories": [
#!/usr/bin/env bash
set -eu
declare -a file_patterns=('app/code/core' 'app/Mage.php$' '^index.php$')
exit_status=0
while read x file; do
for file_pattern in ${file_patterns[@]}; do
if [[ $file =~ $file_pattern ]]; then