Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 15 additions & 55 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@
"docsSlug": "doctrine-mongodb-odm",
"versions": [
{
"name": "2.15",
"branchName": "2.15.x",
"name": "3.0",
"branchName": "3.0.x",
"slug": "3.0",
"upcoming": true
},
{
"name": "2.16",
"branchName": "2.16.x",
"slug": "latest",
"upcoming": true
},
{
"name": "2.15",
"branchName": "2.15.x",
"slug": "2.15",
"current": true
},
{
"name": "2.14",
"branchName": "2.14.x",
"slug": "2.14",
"current": true
"maintained": false
},
{
"name": "2.13",
Expand Down Expand Up @@ -56,57 +67,6 @@
"name": "2.6",
"slug": "2.6",
"maintained": false
},
{
"name": "2.5",
"slug": "2.5",
"maintained": false
},
{
"name": "2.4",
"slug": "2.4",
"maintained": false
},
{
"name": "2.3",
"slug": "2.3",
"maintained": false
},
{
"name": "2.2",
"slug": "2.2",
"maintained": false
},
{
"name": "2.1",
"slug": "2.1",
"maintained": false
},
{
"name": "2.0",
"slug": "2.0",
"maintained": false
},
{
"name": "1.3",
"branchName": "1.3.x",
"slug": "1.3",
"maintained": false
},
{
"name": "1.2",
"slug": "1.2",
"maintained": false
},
{
"name": "1.1",
"slug": "1.1",
"maintained": false
},
{
"name": "1.0",
"slug": "1.0",
"maintained": false
}
]
}
23 changes: 8 additions & 15 deletions .github/workflows/atlas-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ jobs:
matrix:
php-version:
- "8.4"
symfony:
- "stable"
symfony-version:
- ""
proxy:
- "native"
include:
# Test with LazyGhostObject
- php-version: "8.2"
symfony: "7.4"
symfony-version: ""
proxy: "lazy-ghost"
os: "ubuntu-latest"
# Test with ProxyManager
- php-version: "8.1"
symfony: "6.4"
symfony-version: "6.4"
proxy: "proxy-manager"
os: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v5"
uses: "actions/checkout@v6"
with:
fetch-depth: 2

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
tools: "pecl"
tools: "flex"
extensions: "mongodb, bcmath"
coverage: "none"
ini-values: "zend.assertions=1"
Expand All @@ -82,20 +82,13 @@ jobs:
- name: "Remove phpbench/phpbench"
run: composer remove --no-update --dev phpbench/phpbench

- name: "Configure Symfony ${{ matrix.symfony }}"
if: "${{ matrix.symfony != 'stable' }}"
run: |
composer config minimum-stability dev
# update symfony deps
composer require --no-update symfony/console:^${{ matrix.symfony }}
composer require --no-update symfony/var-dumper:^${{ matrix.symfony }}
composer require --no-update --dev symfony/cache:^${{ matrix.symfony }}

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist"
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}

- name: "Run PHPUnit with Atlas Local"
run: "vendor/bin/phpunit --group atlas"
Expand Down
33 changes: 13 additions & 20 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
mongodb-version:
- "8.0"
- "7.0"
Expand All @@ -34,7 +34,7 @@ jobs:
dependencies:
- "highest"
symfony-version:
- "locked"
- "7.4"
proxy:
- "lazy-ghost"
include:
Expand All @@ -44,7 +44,7 @@ jobs:
mongodb-version: "6.0"
driver-version: "1.21.0"
topology: "server"
symfony-version: "locked"
symfony-version: ""
proxy: "lazy-ghost"
# Test with Symfony 6.4
- topology: "server"
Expand All @@ -60,61 +60,53 @@ jobs:
mongodb-version: "6.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "locked"
symfony-version: ""
proxy: "lazy-ghost"
# Test with a 8.0 replica set
- topology: "replica_set"
php-version: "8.2"
mongodb-version: "8.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "locked"
symfony-version: ""
proxy: "lazy-ghost"
# Test with ProxyManager
- php-version: "8.2"
mongodb-version: "6.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "locked"
symfony-version: ""
proxy: "proxy-manager"
# Test with Native Lazy Objects
- php-version: "8.4"
mongodb-version: "8.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "locked"
symfony-version: ""
proxy: "native"
# Test with extension 1.21
- topology: "server"
php-version: "8.2"
mongodb-version: "8.0"
driver-version: "1.21.0"
dependencies: "highest"
symfony-version: "locked"
proxy: "lazy-ghost"
# Test with Symfony 7.4 LTS
- topology: "server"
php-version: "8.2"
mongodb-version: "8.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "7.4"
symfony-version: ""
proxy: "lazy-ghost"
# Test with Symfony 8
- topology: "server"
php-version: "8.4"
mongodb-version: "8.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: false
symfony-version: ""
proxy: "native"
# Test removing optional dependencies
- topology: "server"
php-version: "8.4"
mongodb-version: "8.0"
driver-version: "stable"
dependencies: "highest"
symfony-version: "locked"
symfony-version: ""
proxy: "native"
remove-optional-dependencies: true
# Test with a sharded cluster
Expand All @@ -124,12 +116,12 @@ jobs:
# mongodb-version: "6.0"
# driver-version: "stable"
# dependencies: "highest"
# symfony-version: "locked"
# symfony-version: ""
# proxy: "lazy-ghost"

steps:
- name: "Checkout"
uses: "actions/checkout@v5"
uses: "actions/checkout@v6"
with:
fetch-depth: 2

Expand All @@ -155,6 +147,7 @@ jobs:
extensions: "mongodb-${{ matrix.driver-version }}, bcmath"
coverage: "none"
ini-values: "zend.assertions=1"
tools: "flex"

- name: "Show driver information"
run: "php --ri mongodb"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ on:
jobs:
documentation:
name: "Generate documentation"
uses: "doctrine/.github/.github/workflows/documentation.yml@v12.2.0"
uses: "doctrine/.github/.github/workflows/documentation.yml@13.0.0"
5 changes: 3 additions & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
matrix:
php-version:
- "8.1"
- "8.4"

services:
mongodb:
Expand All @@ -25,7 +26,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v5"
uses: "actions/checkout@v6"

- name: Setup cache environment
id: extcache
Expand Down Expand Up @@ -58,7 +59,7 @@ jobs:
- name: "Upload composer.lock as build artifact"
uses: actions/upload-artifact@v5
with:
name: composer.lock
name: composer.lock-${{ matrix.php-version }}
path: composer.lock

- name: "Run PHPBench"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@v12.2.0"
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@13.0.0"
with:
use-next-minor-as-default-branch: true
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: "Checkout code"
uses: "actions/checkout@v5"
uses: "actions/checkout@v6"

- name: Setup cache environment
id: extcache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ on:
jobs:
json-validate:
name: "Validate JSON schema"
uses: "doctrine/.github/.github/workflows/website-schema.yml@v12.2.0"
uses: "doctrine/.github/.github/workflows/website-schema.yml@13.0.0"
10 changes: 10 additions & 0 deletions UPGRADE-2.16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# UPGRADE FROM 2.15 to 2.16

## Lazy Proxy Directory

Using proxy classes with PHP 8.4+ is deprecated, only native lazy objects will
be supported in MongoDB ODM 3.0.

Calling `Doctrine\ODM\MongoDB\Configuration::setProxyDir()` or
`Doctrine\ODM\MongoDB\Configuration::getProxyDir()` is deprecated and triggers
a deprecation notice when using native lazy objects.
13 changes: 9 additions & 4 deletions benchmark/BaseBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver;
use MongoDB\Client;
use MongoDB\Model\DatabaseInfo;
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

use function array_map;
use function getenv;
use function in_array;
use function iterator_to_array;

/** @BeforeMethods({"initDocumentManager", "clearDatabase"}) */
use const PHP_VERSION_ID;

abstract class BaseBench
{
public const DATABASE_NAME = 'doctrine_odm_performance';
private const DEFAULT_MONGODB_SERVER = 'mongodb://localhost:27017';

/** @var DocumentManager */
protected static $documentManager;
protected static DocumentManager $documentManager;

protected function getDocumentManager(): DocumentManager
{
Expand All @@ -45,6 +44,12 @@ public function initDocumentManager(): void
$config->setMetadataDriverImpl(self::createMetadataDriverImpl());
$config->setMetadataCache(new ArrayAdapter());

if (PHP_VERSION_ID >= 80400) {
$config->setUseNativeLazyObject(true);
} else {
$config->setUseLazyGhostObject(true);
}

$client = new Client(
getenv('DOCTRINE_MONGODB_SERVER') ?: self::DEFAULT_MONGODB_SERVER,
[],
Expand Down
Loading
Loading