8000 [Lock] Deprecate Filesystem/LockHandler by jderusse · Pull Request #8243 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
8000

[Lock] Deprecate Filesystem/LockHandler #8243

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 3 commits into from
Jan 9, 2018
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
6 changes: 6 additions & 0 deletions components/filesystem/lock_handler.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
LockHandler
===========

.. versionadded:: 3.4

The ``LockHandler`` class was deprecated in Symfony 3.4 and it will be
removed in Symfony 4.0. Use ``SemaphoreStore`` or ``FlockStore`` from the
``Lock`` component instead.

What is a Lock?
---------------

Expand Down
9 changes: 6 additions & 3 deletions console/lockable_trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Prevent Multiple Executions of a Console Command
The ``LockableTrait`` was introduced in Symfony 3.2.

A simple but effective way to prevent multiple executions of the same command in
a single server is to use **file locks**. The Filesystem component provides a
:doc:`LockHandler </components/filesystem/lock_handler>` class that eases the
creation and release of these locks.
a single server is to use `locks`_. The :doc:`Lock component </components/lock>`
provides multiple classes to create locks based on the filesystem (:ref:`FlockStore <_lock-store-flock>`),
shared memory (:ref:`SemaphoreStore <_lock-store-semaphore>`) and even databases
and Redis servers.

In addition, the Console component provides a PHP trait called ``LockableTrait``
that adds two convenient methods to lock and release commands::
Expand Down Expand Up @@ -39,3 +40,5 @@ that adds two convenient methods to lock and release commands::
$this->release();
}
}

.. _`locks`: https://en.wikipedia.org/wiki/Lock_(computer_science)
0