public function __construct(dropr_Client_Storage_Abstract $storage)
{
$ipcPath = DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'droprIpc' . DIRECTORY_SEPARATOR;
$channelName = $ipcPath . hash('sha1', realpath($storage->getDsn()));
$this->storage = $storage;
if (!is_dir($ipcPath)) {
mkdir($ipcPath, 0777, true);
}
if (!is_file($channelName)) {
if (!posix_mknod($channelName, 0666)) {
throw new Exception("could not mknod {$channelName}!");
}
}
dropr::log("doing ftok({$channelName})", LOG_DEBUG);
$this->ipcChannel = msg_get_queue(ftok($channelName, '*'));
}