Jenner\SimpleFork\Cache\SharedMemory::attach PHP Method

attach() public method

connect shared memory
public attach ( string $file = __FILE__ )
$file string
    public function attach($file = __FILE__)
    {
        if (!file_exists($file)) {
            $touch = touch($file);
            if (!$touch) {
                throw new \RuntimeException("file is not exists and it can not be created. file: {$file}");
            }
        }
        $key = ftok($file, 'a');
        $this->shm = shm_attach($key, $this->size);
        //allocate shared memory
    }