note 95051 modified in function.msg-queue-exists by danbrown
| From: | danbrown@php.net | Date: | Fri, 11 Dec 2009 00:36:22 +0000 |
| Subject: | note 95051 modified in function.msg-queue-exists by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163833@lists.php.net to get a copy of this message | ||
A workaround for those not yet running 5.3 on *nix:
<?php
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.
--was--
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.
http://php.net/manual/en/function.msg-queue-exists.php