Skip to content

[lock] various fixes #14365

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

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ support blocking, and expects a TTL to avoid stalled locks::

Memcached does not support TTL lower than 1 second.

.. _lock-store-pdo:

.. _lock-store-mongodb:

MongoDbStore
Expand Down Expand Up @@ -339,6 +337,7 @@ MongoDB Connection String:
The ``collection`` querystring parameter is not part of the `MongoDB Connection String`_ definition.
It is used to allow constructing a ``MongoDbStore`` using a `Data Source Name (DSN)`_ without ``$options``.

.. _lock-store-pdo:

PdoStore
~~~~~~~~
Expand All @@ -350,7 +349,7 @@ support blocking, and expects a TTL to avoid stalled locks::
use Symfony\Component\Lock\Store\PdoStore;

// a PDO, a Doctrine DBAL connection or DSN for lazy connecting through PDO
$databaseConnectionOrDSN = 'mysql:host=127.0.0.1;dbname=lock';
$databaseConnectionOrDSN = 'mysql:host=127.0.0.1;dbname=app';
$store = new PdoStore($databaseConnectionOrDSN, ['db_username' => 'myuser', 'db_password' => 'mypassword']);

.. note::
Expand Down
28 changes: 16 additions & 12 deletions lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ this behavior by using the ``lock`` key like:
lock: 'zookeeper://z1.docker'
lock: 'zookeeper://z1.docker,z2.docker'
lock: 'sqlite:///%kernel.project_dir%/var/lock.db'
lock: 'mysql:host=127.0.0.1;dbname=lock'
lock: 'pgsql:host=127.0.0.1;dbname=lock'
lock: 'sqlsrv:server=localhost;Database=test'
lock: 'oci:host=localhost;dbname=test'
lock: 'mysql:host=127.0.0.1;dbname=app'
lock: 'pgsql:host=127.0.0.1;dbname=app'
lock: 'sqlsrv:server=127.0.0.1;Database=app'
lock: 'oci:host=127.0.0.1;dbname=app'
lock: 'mongodb://127.0.0.1/app?collection=lock'
lock: '%env(LOCK_DSN)%'

# named locks
Expand Down Expand Up @@ -102,13 +103,15 @@ this behavior by using the ``lock`` key like:

<framework:resource>sqlite:///%kernel.project_dir%/var/lock.db</framework:resource>

<framework:resource>mysql:host=127.0.0.1;dbname=lock</framework:resource>
<framework:resource>mysql:host=127.0.0.1;dbname=app</framework:resource>

<framework:resource>pgsql:host=127.0.0.1;dbname=lock</framework:resource>
<framework:resource>pgsql:host=127.0.0.1;dbname=app</framework:resource>

<framework:resource>sqlsrv:server=localhost;Database=test</framework:resource>
<framework:resource>sqlsrv:server=127.0.0.1;Database=app</framework:resource>

<framework:resource>oci:host=localhost;dbname=test</framework:resource>
<framework:resource>oci:host=127.0.0.1;dbname=app</framework:resource>

<framework:resource>mongodb://127.0.0.1/app?collection=lock</framework:resource>

<framework:resource>%env(LOCK_DSN)%</framework:resource>

Expand All @@ -135,10 +138,11 @@ this behavior by using the ``lock`` key like:
'lock' => 'zookeeper://z1.docker',
'lock' => 'zookeeper://z1.docker,z2.docker',
'lock' => 'sqlite:///%kernel.project_dir%/var/lock.db',
'lock' => 'mysql:host=127.0.0.1;dbname=lock',
'lock' => 'pgsql:host=127.0.0.1;dbname=lock',
'lock' => 'sqlsrv:server=localhost;Database=test',
'lock' => 'oci:host=localhost;dbname=test',
'lock' => 'mysql:host=127.0.0.1;dbname=app',
'lock' => 'pgsql:host=127.0.0.1;dbname=app',
'lock' => 'sqlsrv:server=127.0.0.1;Database=app',
'lock' => 'oci:host=127.0.0.1;dbname=app',
'lock' => 'mongodb://127.0.0.1/app?collection=lock',
'lock' => '%env(LOCK_DSN)%',

// named locks
Expand Down