dropr_Client::__construct PHP Method

__construct() public method

public __construct ( dropr_Client_Storage_Abstract $storage )
$storage dropr_Client_Storage_Abstract
    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, '*'));
    }