What's the best way, idiomatically, of getting the file contents (into a string) of a flock
'd file in PHP?
Edit: To be clear, this is something 开发者_StackOverflow中文版locked by the current page/process. Something like:
if(flock($fp ...)) {
$str = READFILECONTENTS($fp);
flock(...);
}
Don't. Wait for the lock to be released and only then read it.
Or just read it anyway.
精彩评论