| @@ 58-66 (lines=9) @@ | ||
| 55 | * |
|
| 56 | * @return int |
|
| 57 | */ |
|
| 58 | private function genId() |
|
| 59 | { |
|
| 60 | $pathname = '/tmp/' . self::TMP_FILE_PREFIX . sha1($this->getKey()); |
|
| 61 | if (!file_exists($pathname)) { |
|
| 62 | touch($pathname); |
|
| 63 | } |
|
| 64 | ||
| 65 | return ftok($pathname, 'S'); |
|
| 66 | } |
|
| 67 | ||
| 68 | private function getKey() |
|
| 69 | { |
|
| @@ 109-117 (lines=9) @@ | ||
| 106 | * |
|
| 107 | * @return int |
|
| 108 | */ |
|
| 109 | private function generateKey($pid) |
|
| 110 | { |
|
| 111 | $pathname = '/tmp/' . self::TMP_FILE_PREFIX . sha1($pid); |
|
| 112 | if (!file_exists($pathname)) { |
|
| 113 | touch($pathname); |
|
| 114 | } |
|
| 115 | ||
| 116 | return ftok($pathname, 'S'); |
|
| 117 | } |
|
| 118 | } |
|
| 119 | ||