8000 Added a tip about the TMPDIR env variable · symfony/symfony-docs@565dd93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 565dd93

Browse files
javiereguiluzxabbuh
authored andcommitted
Added a tip about the TMPDIR env variable
1 parent ed3ae3c commit 565dd93

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

components/filesystem/lock_handler.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,19 @@ the file, so you can pass any value for this argument.
4848
to avoid name collisions, ``LockHandler`` also appends a hash to the name of
4949
the lock file.
5050

51-
By default, the lock will be created in the temporary directory, but you can
52-
optionally select the directory where locks are created by passing it as the
53-
second argument of the constructor.
51+
By default, the lock will be created in the system's temporary directory, but
52+
you can optionally select the directory where locks are created by passing it as
53+
the second argument of the constructor.
54+
55+
.. tip::
56+
57+
Another way to configure the directory where the locks are created is to
58+
define a special environment variable, because PHP will use that value to
59+
override the default temporary directory. On Unix-based systems, define the
60+
``TMPDIR`` variable. On Windows systems, define any of these variables:
61+
``TMP``, ``TEMP`` or ``USERPROFILE`` (they are checked in this order). This
62+
technique is useful for example when deploying a third-party Symfony
63+
application whose code can't be modified.
5464

5565
The :method:`Symfony\\Component\\Filesystem\\LockHandler::lock` method tries to
5666
acquire the lock. If the lock is acquired, the method returns ``true``,

0 commit comments

Comments
 (0)
0