#48308 [Opn]: Strongly suggest updating doc page for flock()

From: Date: Sun, 17 May 2009 13:51:26 +0000
Subject: #48308 [Opn]: Strongly suggest updating doc page for flock()
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2269@lists.php.net to get a copy of this message
ID: 48308 Updated by: bjori@php.net Reported By: gutza at moongate dot ro Status: Open -Bug Type: Website problem +Bug Type: Documentation problem Operating System: irrelevant PHP Version: Irrelevant New Comment: Reclassified as documentation problem Previous Comments: ------------------------------------------------------------------------ [2009-05-17 00:14:38] gutza at moongate dot ro And finally (I hope), whatever environment commonality requirements are in place should be disclosed explicitly. In Linux for instance, a lock put in place by a cron job is ignored by a job started in an interactive shell, if two different scripts are called -- if the same script is called locks are respected however, and they are also respected if two different scripts run within the same environment (either cron or shell). ------------------------------------------------------------------------ [2009-05-16 23:48:13] gutza at moongate dot ro Also, the explanation for parameter $operation should NOT read "operation is one of the following", because that's not true (LOCK_NB should be used with LOCK_SH or LOCK_EX, it doesn't make much sense on its own -- I never bothered to test what it does on its own because that's pretty much absurd). ------------------------------------------------------------------------ [2009-05-16 23:29:25] gutza at moongate dot ro (fixed spelling in title) ------------------------------------------------------------------------ [2009-05-16 23:25:07] gutza at moongate dot ro Description: ------------ The documentation page for flock() should clearly state that $handle is symbolically linked. Reproduce code: --------------- <?php $fo = fopen('lockfile.txt','a'); flock($fo,LOCK_EX); $fo = ''; // Lock is disable ?> (This is a copy of mallory dot dessaintes at gmail dot com's User Contributed Note on that page) Expected result: ---------------- Given PHP's usual behavior related to variables, one would expect either that (1) flock() wasn't affected by any subsequent change of $handler, or (2) that this peculiarity would be explicitly documented. Actual result: -------------- Neither of the above. If (1) isn't an option, (2) should be implemented -- that is, the documentation should mention this explicitly. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48308&edit=1

« previous php.doc.bugs (#2269) next »