src/Cache/SharedMemory.php
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
    }
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
    }
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 }
connect shared memory

@param string $file
connect shared memory