Jenner\SimpleFork\Queue\SystemVMessageQueue::getIpcKey PHP Method

getIpcKey() public method

public getIpcKey ( $ipc_filename, $msg_type ) : integer
$ipc_filename
$msg_type
return integer
    public function getIpcKey($ipc_filename, $msg_type)
    {
        if (!file_exists($ipc_filename)) {
            $create_file = touch($ipc_filename);
            if ($create_file === false) {
                throw new \RuntimeException('ipc_file is not exists and create failed');
            }
        }
        $key_t = \ftok($ipc_filename, $msg_type);
        if ($key_t == 0) {
            throw new \RuntimeException('ftok error');
        }
        return $key_t;
    }