Conditions | 5 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function __construct($pathname, $blocking, $mode, $permission = 0666) |
||
24 | { |
||
25 | if (($isExisted = file_exists($pathname)) && filetype($pathname) !== 'fifo') { |
||
26 | throw new InvalidArgumentException("The file already exists, but is not a valid fifo file"); |
||
27 | } |
||
28 | if (!$isExisted && !posix_mkfifo($pathname, $permission)) { |
||
29 | throw new RuntimeException("Cannot create the fifo file"); |
||
30 | } |
||
31 | $this->pathname = $pathname; |
||
32 | $this->blocking = (boolean)$blocking; |
||
33 | $this->mode = $mode; |
||
34 | $this->permission = $permission; |
||
35 | } |
||
36 | |||
72 |