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

Merge release 2.10.0 into 3.0.x #9066

Merged
merged 24 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2362aa1
Fix locking non-existing entity (#9053)
sztyup Sep 30, 2021
eb27aca
Update documentation regarding caching (#9043)
derrabus Sep 30, 2021
9d4fac0
Remove calls to ForeignKeyConstraint::getColumns()
derrabus Oct 2, 2021
149c430
Merge pull request #9056 from derrabus/improvement/foreign-key-get-co…
greg0ire Oct 2, 2021
70b0f50
Add PHP 8.1 to CI (#9006)
derrabus Oct 2, 2021
1d4e12b
Duplicate testTwoIterateHydrations (#9048)
derrabus Oct 2, 2021
7a8c086
Add PHP 8.1 to CI (#9057)
derrabus Oct 2, 2021
5f76874
Run PHP 8.1 CI with stable dependencies (#9058)
derrabus Oct 2, 2021
2e86134
Merge branch '2.9.x' into 2.10.x
derrabus Oct 2, 2021
f805526
Deprecate isIdGeneratorTable and isIdentifierUuid (#9046)
derrabus Oct 3, 2021
9ed1fe5
Pin laminas/automatic-releases to 1.11.1
greg0ire Oct 3, 2021
6d16147
Merge pull request #9061 from greg0ire/revert-to-older-automatic-rele…
greg0ire Oct 3, 2021
e800f90
Pin laminas/automatic-releases to 1.11.1
greg0ire Oct 3, 2021
ddcea63
Try using docker image directly
greg0ire Oct 3, 2021
3a3b53e
Avoid triggering workflows for tags
greg0ire Oct 3, 2021
22added
Merge pull request #9062 from greg0ire/dont-run-workflows-for-tags
greg0ire Oct 3, 2021
63f3abf
Avoid triggering workflows for tags
greg0ire Oct 3, 2021
bbe4022
Explicitly disallow workflows for tags
greg0ire Oct 3, 2021
b734a7d
Merge pull request #9063 from greg0ire/explicitly-disallow-workflows-…
greg0ire Oct 3, 2021
e8a221d
Use org admin token
greg0ire Oct 3, 2021
73fa465
Merge pull request #9064 from greg0ire/use-org-token
greg0ire Oct 3, 2021
5918cfa
Merge remote-tracking branch 'origin/2.9.x' into 2.10.x
greg0ire Oct 3, 2021
07e15a0
Merge pull request #9065 from greg0ire/2.10.x
greg0ire Oct 3, 2021
512dfd6
Merge remote-tracking branch 'origin/2.10.x' into 3.0.x
greg0ire Oct 3, 2021
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
11 changes: 10 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ name: "Continuous Integration"

on:
pull_request:
branches:
- "*.x"
tag-ignore:
- "*"
push:
branches:
- "*.x"
tag-ignore:
- "*"

env:
fail-fast: true
Expand All @@ -19,12 +27,13 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
dbal-version:
- "default"
include:
- php-version: "8.0"
dbal-version: "2.13"
- php-version: "8.0"
- php-version: "8.1"
dbal-version: "3.2@dev"

steps:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,36 @@ jobs:
uses: "actions/checkout@v2"

- name: "Release"
uses: "laminas/automatic-releases@v1"
# revert to v1 when
# https://github.com/laminas/automatic-releases/issues/166 is fixed
uses: "docker://ghcr.io/laminas/automatic-releases:1.11.1"
with:
command-name: "laminas:automatic-releases:release"
args: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
"SHELL_VERBOSITY": "3"

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
# revert to v1 when
# https://github.com/laminas/automatic-releases/issues/166 is fixed
uses: "docker://ghcr.io/laminas/automatic-releases:1.11.1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
args: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
# revert to v1 when
# https://github.com/laminas/automatic-releases/issues/166 is fixed
uses: "docker://ghcr.io/laminas/automatic-releases:1.11.1"
with:
command-name: "laminas:automatic-releases:create-milestones"
args: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
Expand Down
7 changes: 5 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ downstream packages or applications, and were consequently removed:
## Deprecated: database-side UUID generation

[DB-generated UUIDs are deprecated as of `doctrine/dbal` 2.8][DBAL deprecation].
As a consequence, `Doctrine\ORM\Id\UuidGenerator` is deprecated, and using the
`UUID` strategy for generating identifiers is deprecated as well.
As a consequence, using the `UUID` strategy for generating identifiers is deprecated as well.
Furthermore, relying on the following classes and methods is deprecated:

- `Doctrine\ORM\Id\UuidGenerator`
- `Doctrine\ORM\Mapping\ClassMetadataInfo::isIdentifierUuid()`

[DBAL deprecation]: https://github.com/doctrine/dbal/pull/3212

Expand Down
88 changes: 39 additions & 49 deletions docs/en/reference/advanced-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@ steps of configuration.
.. code-block:: php

<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration;

use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;

// ...

if ($applicationMode == "development") {
$cache = new \Doctrine\Common\Cache\ArrayCache;
$queryCache = new ArrayAdapter();
$metadataCache = new ArrayAdapter();
} else {
$cache = new \Doctrine\Common\Cache\ApcCache;
$queryCache = new PhpFilesAdapter('doctrine_queries');
$metadataCache = new PhpFilesAdapter('doctrine_metadata');
}

$config = new Configuration;
$config->setMetadataCacheImpl($cache);
$config->setMetadataCache($metadataCache);
$driverImpl = $config->newDefaultAnnotationDriver('/path/to/lib/MyProject/Entities');
$config->setMetadataDriverImpl($driverImpl);
$config->setQueryCacheImpl($cache);
$config->setQueryCache($queryCache);
$config->setProxyDir('/path/to/myproject/lib/MyProject/Proxies');
$config->setProxyNamespace('MyProject\Proxies');

Expand All @@ -41,19 +46,22 @@ steps of configuration.

$em = EntityManager::create($connectionOptions, $config);

Doctrine and Caching
--------------------

Doctrine is optimized for working with caches. The main parts in Doctrine
that are optimized for caching are the metadata mapping information with
the metadata cache and the DQL to SQL conversions with the query cache.
These 2 caches require only an absolute minimum of memory yet they heavily
improve the runtime performance of Doctrine.

Doctrine does not bundle its own cache implementation anymore. Instead,
the PSR-6 standard interfaces are used to access the cache. In the examples
in this documentation, Symfony Cache is used as a reference implementation.

.. note::

Do not use Doctrine without a metadata and query cache!
Doctrine is optimized for working with caches. The main
parts in Doctrine that are optimized for caching are the metadata
mapping information with the metadata cache and the DQL to SQL
conversions with the query cache. These 2 caches require only an
absolute minimum of memory yet they heavily improve the runtime
performance of Doctrine. The recommended cache driver to use with
Doctrine is `APC <https://php.net/apc>`_. APC provides you with
an opcode-cache (which is highly recommended anyway) and a very
fast in-memory cache storage that you can use for the metadata and
query caches as seen in the previous code snippet.

Configuration Options
---------------------
Expand Down Expand Up @@ -137,39 +145,30 @@ Metadata Cache (***RECOMMENDED***)
.. code-block:: php

<?php
$config->setMetadataCacheImpl($cache);
$config->getMetadataCacheImpl();
$config->setMetadataCache($cache);
$config->getMetadataCache();

Gets or sets the cache implementation to use for caching metadata
Gets or sets the cache adapter to use for caching metadata
information, that is, all the information you supply via
annotations, xml or yaml, so that they do not need to be parsed and
loaded from scratch on every single request which is a waste of
resources. The cache implementation must implement the
``Doctrine\Common\Cache\Cache`` interface.
resources. The cache implementation must implement the PSR-6
``Psr\Cache\CacheItemPoolInterface`` interface.

Usage of a metadata cache is highly recommended.

The recommended implementations for production are:


- ``Doctrine\Common\Cache\ApcCache``
- ``Doctrine\Common\Cache\ApcuCache``
- ``Doctrine\Common\Cache\MemcacheCache``
- ``Doctrine\Common\Cache\XcacheCache``
- ``Doctrine\Common\Cache\RedisCache``

For development you should use the
``Doctrine\Common\Cache\ArrayCache`` which only caches data on a
per-request basis.
For development you should use an array cache like
``Symfony\Component\Cache\Adapter\ArrayAdapter``
which only caches data on a per-request basis.

Query Cache (***RECOMMENDED***)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: php

<?php
$config->setQueryCacheImpl($cache);
$config->getQueryCacheImpl();
$config->setQueryCache($cache);
$config->getQueryCache();

Gets or sets the cache implementation to use for caching DQL
queries, that is, the result of a DQL parsing process that includes
Expand All @@ -181,18 +180,9 @@ minimal memory usage in your cache).

Usage of a query cache is highly recommended.

The recommended implementations for production are:


- ``Doctrine\Common\Cache\ApcCache``
- ``Doctrine\Common\Cache\ApcuCache``
- ``Doctrine\Common\Cache\MemcacheCache``
- ``Doctrine\Common\Cache\XcacheCache``
- ``Doctrine\Common\Cache\RedisCache``

For development you should use the
``Doctrine\Common\Cache\ArrayCache`` which only caches data on a
per-request basis.
For development you should use an array cache like
``Symfony\Component\Cache\Adapter\ArrayAdapter``
which only caches data on a per-request basis.

SQL Logger (***Optional***)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -269,10 +259,10 @@ Development vs Production Configuration

You should code your Doctrine2 bootstrapping with two different
runtime models in mind. There are some serious benefits of using
APC or Memcache in production. In development however this will
APCu or Memcache in production. In development however this will
frequently give you fatal errors, when you change your entities and
the cache still keeps the outdated metadata. That is why we
recommend the ``ArrayCache`` for development.
recommend an array cache for development.

Furthermore you should have the Auto-generating Proxy Classes
option to true in development and to false in production. If this
Expand Down
Loading