Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add storage to auto for shopware app bundle #1680

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Sep 23, 2024

Q A
License MIT
Packagist https://packagist.org/packages/shopware/app-bundle

Instead of using hard-code in-memory, we let auto detect the storage so it's more convenient for users to install

Copy link

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1680/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1680/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'shopware/app-bundle:^4.0'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

shopware/app-bundle

1.0 vs 4.0
diff --git a/shopware/app-bundle/1.0/config/packages/shopware_app.yaml b/shopware/app-bundle/4.0/config/packages/shopware_app.yaml
index 645d80a3..1c40076a 100644
--- a/shopware/app-bundle/1.0/config/packages/shopware_app.yaml
+++ b/shopware/app-bundle/4.0/config/packages/shopware_app.yaml
@@ -1,5 +1,7 @@
 shopware_app:
-    shop_class: App\Entity\Shop
     name: '%env(SHOPWARE_APP_NAME)%'
     secret: '%env(SHOPWARE_APP_SECRET)%'
-
+    # You should specify a specific storage like: dynamodb or doctrine
+    storage: 'auto'
+    doctrine:
+        shop_class: App\Entity\Shop
diff --git a/shopware/app-bundle/4.0/post-install.txt b/shopware/app-bundle/4.0/post-install.txt
new file mode 100644
index 00000000..3c53f3e3
--- /dev/null
+++ b/shopware/app-bundle/4.0/post-install.txt
@@ -0,0 +1,6 @@
+  * Warning the shopware/app-bundle uses by default a in-memory database. You should use doctrine or dynamodb
+
+    For doctrine install the following packages: composer require doctrine/orm symfony/doctrine-bridge
+    For dynamodb install the following packages: composer require async-aws/async-aws-bundle async-aws/dynamo-db
+
+    Make sure to configure the correct storage after installing the packages in config/packages/shopware_app.yaml

@shyim
Copy link
Contributor Author

shyim commented Sep 23, 2024

Symfony 5 failure is fine, we don't support it

@symfony-recipes-bot symfony-recipes-bot merged commit 8dde63d into symfony:main Oct 6, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants