public function open($segno = 0, $create = false)
{
if (isset($this->segments[$segno])) {
return $this->segments[$segno];
}
$key = $this->key + $segno;
if (!$create) {
$shm = @shmop_open($key, 'w', 0, 0);
} else {
$shm = @shmop_open($key, 'w', 0, 0);
if ($shm) {
shmop_delete($shm);
shmop_close($shm);
}
$shm = shmop_open($key, 'c', 0755, $this->segsize);
}
if (!$shm) {
return false;
}
$this->segments[$segno] = $shm;
return $shm;
}