ntzrbtr / shopware-plugin-management
Tools for plugin management in Shopware 6
Installs: 1 017
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2 || ^8.3
- justinrainbow/json-schema: ^5.2
- shopware/core: ^6.6
README
This package provides a simple way to manage your Shopware plugins. It can handle the installation, update and removal of plugins.
The package provides a new command netzarbeiter:plugin:manage
which can be used to manage your plugins. The command
takes a JSON file with plugins that should be active in your Shopware installation.
Usage
bin/console netzarbeiter:plugin:manage <file>
Options
--dry-run
Do not install or uninstall plugins, just show what would be done.
plugins.json
The command takes a JSON file with the following schema:
{ "<plugin name>": { "active": true|false, "update": true|false|"force" } }
The command will install all plugins in that file, activate them if active
is true
and update them if update
is
true
and an update is available or if update
is set to "force"
(useful for local plugins).
The command will afterwards uninstall all plugins that are installed in your Shopware installation, but are not in the
plugins.json
file.
Automation
You can use the command in your CI/CD pipeline to automate the installation of plugins. To do so, you can add the
command as a post-update script to your composer.json
file:
{ "scripts": { "post-install-cmd": [ "[ ! -f vendor/autoload.php ] || [ ! -f plugins.json ] || ($PHP_BINARY bin/console plugin:refresh -s && $PHP_BINARY bin/console netzarbeiter:plugins:handle plugins.json)" ], "post-update-cmd": [ "[ ! -f vendor/autoload.php ] || [ ! -f plugins.json ] || ($PHP_BINARY bin/console plugin:refresh -s && $PHP_BINARY bin/console netzarbeiter:plugins:handle plugins.json)" ] } }
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
$ composer require <package-name>
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require <package-name>
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... Netzarbeiter\Shopware\PluginManagement\NetzarbeiterShopwarePluginManagementBundle::class => ['all' => true], ];