FriendsOfShopware / FroshTools

A collection of useful tools for Shopware 6
MIT License
59 stars 28 forks source link

Frosh Tools

This plugin contains some utility functions for managing a Shopware 6 shop.

The current feature set consists of:

Installation

Git

Packagist

composer require frosh/tools

Store (Bearer token required from packages.shopware.com)

composer require store.shopware.com/froshtools

Commands

frosh:env:list - Listing of all environment variables

bin/console frosh:env:list

Lists as json output:

bin/console frosh:env:list --json

frosh:env:get - Get environment variables

bin/console frosh:env:get APP_URL
http://localhost
bin/console frosh:env:get APP_URL --key-value
APP_URL=http://localhost
bin/console frosh:env:get APP_URL --json
{
    "APP_URL": "http:\/\/localhost"
}

frosh:env:set - Set environment variables

bin/console frosh:env:set VARIABLE VALUE

frosh:env:del - Delete environment variables

bin/console frosh:env:del VARIABLE

frosh:dev:robots-txt - For testshops - add/change robots.txt to stop crawlers

bin/console frosh:dev:robots-txt

frosh:dev:robots-txt -r - For testshops - revert changes in robots.txt

bin/console frosh:dev:robots-txt -r

frosh:plugin:update - update plugins with available updates at once

bin/console frosh:plugin:update

frosh:composer-plugin:update - update plugins managed by composer

bin/console frosh:composer-plugin:update

frosh:user:change:password - updates user password

bin/console frosh:user:change:password <username> [<password>]

frosh:monitor - Monitor your scheduled tasks and queue with this command and get notified via email.

bin/console frosh:monitor <sales-channel-id>

Suppress files from being restorable in FileChecker

# config/packages/frosh_tools.yaml
frosh_tools:
    file_checker:
        exclude_files:
            - vendor/shopware/core/FirstFile.php
            - vendor/shopware/core/SecondFile.php

Override system_config with config files

# config/packages/frosh_tools.yaml
frosh_tools:
    system_config:
        default:
            core.listing.allowBuyInListing: true

The key default is the sales channel scope, default is null which is the global scope. You can specify a specific salesChannelId to overwrite the value

# config/packages/frosh_tools.yaml
frosh_tools:
    system_config:
        default:
            core.listing.allowBuyInListing: true
        # Disable it for the specific sales channel
        0188da12724970b9b4a708298259b171:
            core.listing.allowBuyInListing: false

As it is a normal Symfony config, you can of course use also environment variables

# config/packages/frosh_tools.yaml
frosh_tools:
    system_config:
        default:
            core.listing.allowBuyInListing: '%env(bool:ALLOW_BUY_IN_LISTING)%'
# .env.local
ALLOW_BUY_IN_LISTING=true

Screenshots

System Status Cache Manager Scheduled Task Manager Queue Manager Log Viewer File Checker Elasticsearch Manager Feature Flags State Machine Viewer