| @@ 76-81 (lines=6) @@ | ||
| 73 | throw new \RuntimeException($error['message'], 0, null, $this->file); |
|
| 74 | } |
|
| 75 | ||
| 76 | if (!flock($this->handle, LOCK_EX | LOCK_NB)) { |
|
| 77 | fclose($this->handle); |
|
| 78 | $this->handle = null; |
|
| 79 | ||
| 80 | return false; |
|
| 81 | } |
|
| 82 | ||
| 83 | return true; |
|
| 84 | } |
|
| @@ 91-95 (lines=5) @@ | ||
| 88 | */ |
|
| 89 | public function release() |
|
| 90 | { |
|
| 91 | if ($this->handle) { |
|
| 92 | flock($this->handle, LOCK_UN | LOCK_NB); |
|
| 93 | fclose($this->handle); |
|
| 94 | $this->handle = null; |
|
| 95 | } |
|
| 96 | } |
|
| 97 | } |
|
| 98 | ||