torq / shopwarecommon
torq/shopwarecommon
Package info
github.com/TorqIT/shopware-common
Type:shopware-platform-plugin
pkg:composer/torq/shopwarecommon
Requires
- defuse/php-encryption: ^2.3
- shopware/core: ^6.7.0
- symfony/http-kernel: ^7.1.1
This package is auto-updated.
Last update: 2026-05-21 18:52:07 UTC
README
This repository (plugin) provides a centralized location for commonly reused code across multiple Torq Shopware projects, ensuring a single point of truth for shared functionality and enabling easier maintenance.
Package Versions
Shopware 6.6.x use branch v3.x
Shopware 6.7.x use branch v4.x
Adding a Submodule to an existing repository
Run the following command to create the shopwarecommon submodule in an existing Torq Showpare repo, then perform the steps in Submodule Installation.
git submodule add -f https://github.com/TorqIT/shopware-common src/custom/plugins/TorqShopwareCommon
Updating Submodule
After cloning your Git repository for the first time, pull down the submodule code by executing the following commands.
git submodule init git submodule update
Note: This ensures the submodule is initialized and its content is fetched.
Submodule Installation
To install the submodule and set up the container, follow these steps:
-
Build and start the container:
docker compose up --build
-
Access the container: Connect to the container as the www-data user by running:
docker compose exec -it -u www-data php bash -
Install the
shopwarecommonplugin: Inside the container, add the shopwarecommon plugin to your Shopware project using Composer:composer require torq/shopwarecommon <version_number_here>
Note: The
composer requirecommand will add the shopwarecommon plugin as a dependency and update thecomposer.jsonandcomposer.lockfiles accordingly. It will also add the necessary files and folders to the vendor directory.
Encryption
Presently we're using the defuse/php-encryption library for handling encryption, and our wrapper class is TorqShopwareCommon/src/Security/Encryption/EncryptionHandler.php.
In order to use this plugin successfully your project will need to have an environment variable called TORQ_SHOPWARE_COMMON_ENCRYPTION_SECRET. The value of this can be generated using the included key generation tool available inside of all PHP containers at vendor/bin/generate-defuse-key.
YOU MUST FOLLOW THESE RULES WHEN MANAGING KEYS:
-
NEVER PUT THE ENCRYPTION KEY DIRECTLY INSIDE THE CONFIG FILE
-
NEVER COMMIT AN ENCRYPTION KEY TO A REPOSITORY
-
NEVER USE THE SAME ENCRYPTION KEY IN DEV, TEST or PROD ENVIRONMENTS.