note 95277 deleted from function.msg-queue-exists by danbrown

From: Date: Wed, 23 Dec 2009 18:26:07 +0000
Subject: note 95277 deleted from function.msg-queue-exists by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164280@lists.php.net to get a copy of this message
Note Submitter: secteur52 at gmail dot com ---- my server is under debian with php 5.2.4 I tried your function. However in my case i have to make a little modification to match the $key using dechex() : function _msg_queue_exists($key) { if(function_exists("msg_queue_exists")) { return msg_queue_exists($key); } else { $hex_key = "0x".str_pad(strval(dechex($key)),8,"0",STR_PAD_LEFT); $aQueues = array(); exec("ipcs -q | grep \"^[0-9]\" | cut -d \" \" -f 1", $aQueues); if(in_array($hex_key,$aQueues)) return true; else return false; } }

« previous php.notes (#164280) next »