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

Add doctrine/mongodb-odm-bundle v5 without is_bundle (default to false) #1582

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Jan 8, 2024

Q A
License MIT
Packagist

The is_bundle and alias configs are not required by default.

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) January 8, 2024 16:35
Copy link

github-actions bot commented Jan 8, 2024

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-1582/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1582/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'doctrine/mongodb-odm-bundle:^5.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.

doctrine/mongodb-odm-bundle

3.3 vs 4.1
diff --git a/doctrine/mongodb-odm-bundle/3.3/config/packages/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
index a9a22024..52103e7e 100644
--- a/doctrine/mongodb-odm-bundle/3.3/config/packages/doctrine_mongodb.yaml
+++ b/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
@@ -16,3 +16,27 @@ doctrine_mongodb:
                     dir: '%kernel.project_dir%/src/Document'
                     prefix: 'App\Document'
                     alias: App
+
+when@prod:
+    doctrine_mongodb:
+        auto_generate_proxy_classes: false
+        auto_generate_hydrator_classes: false
+        document_managers:
+            default:
+                metadata_cache_driver:
+                    type: service
+                    id: doctrine_mongodb.system_cache_provider
+
+    services:
+        doctrine_mongodb.system_cache_provider:
+            factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
+            class: 'Doctrine\Common\Cache\Psr6\DoctrineProvider'
+            public: false
+            arguments:
+                - '@doctrine_mongodb.system_cache_pool'
+
+    framework:
+        cache:
+            pools:
+                doctrine_mongodb.system_cache_pool:
+                    adapter: cache.system
diff --git a/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml
deleted file mode 100644
index 60f6b834..00000000
--- a/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-doctrine_mongodb:
-    auto_generate_proxy_classes: false
-    auto_generate_hydrator_classes: false
-    document_managers:
-        default:
-            metadata_cache_driver:
-                type: service
-                id: doctrine_mongodb.system_cache_provider
-
-services:
-    doctrine_mongodb.system_cache_provider:
-        class: Symfony\Component\Cache\DoctrineProvider
-        public: false
-        arguments:
-            - '@doctrine_mongodb.system_cache_pool'
-
-framework:
-    cache:
-        pools:
-            doctrine_mongodb.system_cache_pool:
-                adapter: cache.system
diff --git a/doctrine/mongodb-odm-bundle/3.3/manifest.json b/doctrine/mongodb-odm-bundle/4.1/manifest.json
index 65b64f0b..56b37712 100644
--- a/doctrine/mongodb-odm-bundle/3.3/manifest.json
+++ b/doctrine/mongodb-odm-bundle/4.1/manifest.json
@@ -13,5 +13,9 @@
     "env": {
         "MONGODB_URL": "mongodb://localhost:27017",
         "MONGODB_DB": "symfony"
+    },
+    "conflict": {
+        "doctrine/cache": "<1.11",
+        "symfony/framework-bundle": "<5.3"
     }
 }
4.1 vs 4.4
diff --git a/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml
index 52103e7e..999eb958 100644
--- a/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
+++ b/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml
@@ -12,7 +12,6 @@ doctrine_mongodb:
             mappings:
                 App:
                     is_bundle: false
-                    type: annotation
                     dir: '%kernel.project_dir%/src/Document'
                     prefix: 'App\Document'
                     alias: App
@@ -25,15 +24,7 @@ when@prod:
             default:
                 metadata_cache_driver:
                     type: service
-                    id: doctrine_mongodb.system_cache_provider
-
-    services:
-        doctrine_mongodb.system_cache_provider:
-            factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
-            class: 'Doctrine\Common\Cache\Psr6\DoctrineProvider'
-            public: false
-            arguments:
-                - '@doctrine_mongodb.system_cache_pool'
+                    id: doctrine_mongodb.system_cache_pool
 
     framework:
         cache:
diff --git a/doctrine/mongodb-odm-bundle/4.1/manifest.json b/doctrine/mongodb-odm-bundle/4.4/manifest.json
index 56b37712..65b64f0b 100644
--- a/doctrine/mongodb-odm-bundle/4.1/manifest.json
+++ b/doctrine/mongodb-odm-bundle/4.4/manifest.json
@@ -13,9 +13,5 @@
     "env": {
         "MONGODB_URL": "mongodb://localhost:27017",
         "MONGODB_DB": "symfony"
-    },
-    "conflict": {
-        "doctrine/cache": "<1.11",
-        "symfony/framework-bundle": "<5.3"
     }
 }
4.4 vs 5.0
diff --git a/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/5.0/config/packages/doctrine_mongodb.yaml
index 999eb958..e0326566 100644
--- a/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml
+++ b/doctrine/mongodb-odm-bundle/5.0/config/packages/doctrine_mongodb.yaml
@@ -11,10 +11,8 @@ doctrine_mongodb:
             auto_mapping: true
             mappings:
                 App:
-                    is_bundle: false
                     dir: '%kernel.project_dir%/src/Document'
                     prefix: 'App\Document'
-                    alias: App
 
 when@prod:
     doctrine_mongodb:

@symfony-recipes-bot symfony-recipes-bot merged commit 98257df into symfony:main Jan 8, 2024
1 of 2 checks passed
@GromNaN GromNaN deleted the doctrine-odm-bundle-5 branch April 15, 2024 21:09
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