note 95051 added to function.msg-queue-exists
| From: | jaredm at osu1 dot php dot net | Date: | Fri, 11 Dec 2009 00:31:59 +0000 |
| Subject: | note 95051 added to function.msg-queue-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163832@lists.php.net to get a copy of this message | ||
A workaround for those not yet running 5.3 on *nix:
function queue_exists($key) {
if(function_exists("msg_queue_exists")) {
return msg_queue_exists($key);
} else {
$aQueues = array();
exec("ipcs -q | grep \"^[0-9]\" | cut -d \" \" -f 1", $aQueues);
if(in_array($key,$aQueues)) return true;
else return false;
}
}
Maybe a bit slow and kludgey, but it works.
----
Server IP: 69.147.83.197
Probable Submitter: 64.126.168.95
----
Manual Page -- http://www.php.net/manual/en/function.msg-queue-exists.php
Edit -- https://master.php.net/note/edit/95051
Del: integrated -- https://master.php.net/note/delete/95051/integrated
Del: useless -- https://master.php.net/note/delete/95051/useless
Del: bad code -- https://master.php.net/note/delete/95051/bad+code
Del: spam -- https://master.php.net/note/delete/95051/spam
Del: non-english -- https://master.php.net/note/delete/95051/non-english
Del: in docs -- https://master.php.net/note/delete/95051/in+docs
Del: other reasons-- https://master.php.net/note/delete/95051
Reject -- https://master.php.net/note/reject/95051
Search -- https://master.php.net/manage/user-notes.php