Plugin Directory

Changeset 1406786


Ignore:
Timestamp:
04/28/2016 08:08:29 PM (10 years ago)
Author:
Ali.Dbg
Message:

Update v4.1.1 #2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-farsi/trunk/wp-farsi.php

    r1406785 r1406786  
    3434function wpfa_file_put_contents($file = '', $str = '') {
    3535    $fp = fopen($file, "w");
    36     if (!$fp || !flock($fp, 6, $e) || $e)
     36    if (!$fp || !flock($fp, LOCK_EX | LOCK_NB, $e) || $e)
    3737        return false;
    3838    fwrite($fp, $str);
    3939    sleep(2);
    40     flock($fp, 3);
     40    flock($fp, LOCK_UN);
    4141    fclose($fp);
    4242}
     
    4545    $content = '';
    4646    $fp = fopen($file, "r");
    47     if (!$fp || !flock($fp, 6, $e) || $e)
     47    if (!$fp || !flock($fp, LOCK_EX | LOCK_NB, $e) || $e)
    4848        return false;
    4949    $content = fread($fp, filesize($file));
    5050    usleep(100000);
    51     flock($fp, 3);
     51    flock($fp, LOCK_UN);
    5252    fclose($fp);
    5353    return $content;
Note: See TracChangeset for help on using the changeset viewer.