Skip to content

Instantly share code, notes, and snippets.

@emtii
emtii / sw5_install.sh
Last active July 24, 2016 19:13
sw5_install
#!/bin/bash
wget http://releases.s3.shopware.com.s3.amazonaws.com/install_5.0.4_5b69a44ab451eced9f970bc7732d2a4cc7176e45.zip
unzip install_5.0.4_5b69a44ab451eced9f970bc7732d2a4cc7176e45.zip
chmod 777 bin/console
chmod 777 logs/
chmod 777 config.php
chmod 777 cache/
chmod 777 web/cache/
chmod 777 files/documents/
@emtii
emtii / sw5_logging.txt
Last active October 17, 2016 17:50
sw5_logging
// var/log/debug_*.log
Shopware()->Debuglogger();
// var/log/core_*.log
Shopware()->Corelogger();
// var/log/plugin_*.log
Shopware()->Pluginlogger()
Zugriff jeweils auf die Monolog Methoden möglich (https://github.com/Seldaek/monolog).
@emtii
emtii / sw5_config_dev.php
Last active May 5, 2019 19:44
sw5_config_dev
<?php
return [
// database settings
'db' => [
'host' => 'localhost',
'port' => '3306',
'username' => 'shopware',
'password' => 'shopware',
'dbname' => 'shopware'
@emtii
emtii / sw5_howto_debug.txt
Created July 24, 2016 19:29
sw5_debugging
1. use google chrome, newest version
2. install chrome extension "webug" (https://chrome.google.com/webstore/detail/webug/cjbeipenlpoeifpkjhgakejmikdhlhcj?hl=en)
3. install + activate plugin "debug" in shopware plugin manager
4. open google chrome developer tools
5. view console
6. open shopware frontend, see results in console, have fun
optional: add stuff by yourself with monolog. See my other gist (https://gist.github.com/emtii/d1a08f45311c01629995d66acdc7d4ef)
@emtii
emtii / sw5_config_production.php
Created August 23, 2016 13:16
example production config for shopware 5
<?php
return [
// database settings
'db' => [
'host' => 'localhost',
'port' => '3306',
'username' => 'shopware',
'password' => 'shopware',
'dbname' => 'shopware'
@emtii
emtii / delete_articles_sw511.txt
Last active October 17, 2016 17:49
Deletes Articles from Shopware 5.1.1
Description
====================================================================================================================
We basically need 2 steps to completely remove articles from this shopware version:
1. truncate mysql tables
2. use sw cli command to remove left images from filesystem
1. truncate
====================================================================================================================
SET foreign_key_checks = 0;
@emtii
emtii / boilterplate-sw5_plugin_json.json
Created October 22, 2016 08:33
best it Boilerplate for Shopware 5 Plugin json filled with meta data.
{
"label": {
"de": "BestitFoobar",
"en": "BestitFoobar"
},
"copyright": "Copyright (c) best it GmbH & Co. KG",
"license": "proprietary",
"link": "http://www.bestit-online.de",
"author": "best it GmbH & Co. KG",
"supplier": "best it GmbH & Co. KG",
@emtii
emtii / shopware_get_all_versions_to_local.sh
Last active February 2, 2017 10:39
wget all shopware versions available as zip archives on github to local and unzip those.
#!/bin/bash
# array of file names in github = shopware versions
ARRAY=( v5.2.16 v5.2.15 v5.2.14 v5.2.13 v5.2.12 v5.2.11 v5.2.10 v5.2.9 v5.2.8 v5.2.7 v5.2.6 v5.2.5 v5.2.4 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.1.6 v5.1.5 v5.1.4 v5.1.3 v5.1.1 v5.1.0 v5.0.4 v5.0.3 v5.0.2 v5.0.1 v5.0.0 4.3.7 4.3.6 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 4.2.0 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 )
# iterate filenames, wget files, unzip files
for (( i = 0; i < ${#ARRAY[@]}; ++i )); do
DIRNAME="shopware-${ARRAY[i]}"
FILENAME="${ARRAY[i]}.zip"
@emtii
emtii / delete_instance_sw511.txt
Last active November 9, 2016 15:51
delete_instance_sw511
Description
====================================================================================================================
We basically need 2 steps to completely remove articles, categories & suppliers from this shopware version:
1. truncate mysql tables
2. use sw cli command to remove left images from filesystem
1. truncate
====================================================================================================================
SET foreign_key_checks = 0;
@emtii
emtii / getGitUserStats.sh
Created November 21, 2016 21:33
Get GIT User Stats
#!/bin/bash
git log --author="$0" --pretty=tformat: --numstat \
| gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -