diff --git a/components/filesystem/lock_handler.rst b/components/filesystem/lock_handler.rst index 5d442e79547..522b0a29507 100644 --- a/components/filesystem/lock_handler.rst +++ b/components/filesystem/lock_handler.rst @@ -48,9 +48,19 @@ the file, so you can pass any value for this argument. to avoid name collisions, ``LockHandler`` also appends a hash to the name of the lock file. -By default, the lock will be created in the temporary directory, but you can -optionally select the directory where locks are created by passing it as the -second argument of the constructor. +By default, the lock will be created in the system's temporary directory, but +you can optionally select the directory where locks are created by passing it as +the second argument of the constructor. + +.. tip:: + + Another way to configure the directory where the locks are created is to + define a special environment variable, because PHP will use that value to + override the default temporary directory. On Unix-based systems, define the + ``TMPDIR`` variable. On Windows systems, define any of these variables: + ``TMP``, ``TEMP`` or ``USERPROFILE`` (they are checked in this order). This + technique is useful for example when deploying a third-party Symfony + application whose code can't be modified. The :method:`Symfony\\Component\\Filesystem\\LockHandler::lock` method tries to acquire the lock. If the lock is acquired, the method returns ``true``,