Skip to content

Commit 280a903

Browse files
committed
minor #13042 [Lock] Default path for FlockStore (Guikingone)
This PR was merged into the 3.4 branch. Discussion ---------- [Lock] Default path for FlockStore Hi everyone 👋 As noticed in the source code: ```php /** * @param string|null $lockPath the directory to store the lock, defaults to the system's temporary directory * * @throws LockStorageException If the lock directory doesn’t exist or is not writable */ public function __construct(string $lockPath = null) { if (null === $lockPath) { $lockPath = sys_get_temp_dir(); } if (!is_dir($lockPath) || !is_writable($lockPath)) { throw new InvalidArgumentException(sprintf('The directory "%s" is not writable.', $lockPath)); } $this->lockPath = $lockPath; } ``` `sys_get_temp_dir` is the default path is null is given in the constructor, could it be a good idea to notice this? 🤔 Commits ------- efbb0b3 refacto(Lock): FlockStore default path
2 parents 4288b0f + efbb0b3 commit 280a903

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/lock.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ PHP process is terminated::
227227
// the argument is the path of the directory where the locks are created
228228
$store = new FlockStore(sys_get_temp_dir());
229229

230+
.. note::
231+
232+
If no path is given, ``sys_get_temp_dir`` is used as default value.
233+
230234
.. caution::
231235

232236
Beware that some file systems (such as some types of NFS) do not support

0 commit comments

Comments
 (0)