torq / shopwarecommon
torq/shopwarecommon
Installs: 1 225
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:shopware-platform-plugin
Requires
- defuse/php-encryption: ^2.3
- shopware/core: ~6.6.0
- symfony/http-kernel: ~7.1.1
- dev-main
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/password-strength
- dev-remove-hardcoded-db-ref
- dev-feat/customer-address-custom-field-rule
- dev-feat/instock-filter
- dev-feat/custom-pricing-and-common-project-update
- dev-feat/cms-route
- dev-feat/sw-data-sync
- dev-feat/download-as-excel
This package is auto-updated.
Last update: 2025-03-28 14:28:57 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.
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
shopwarecommon
plugin: Inside the container, add the shopwarecommon plugin to your Shopware project using Composer:composer require torq/shopwarecommon <version_number_here>
Note: The
composer require
command will add the shopwarecommon plugin as a dependency and update thecomposer.json
andcomposer.lock
files 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.