Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 11108

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Read one or more messages from a queue without removing it from the queue.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.peek.html">SAMConnection::peek</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.receive.html">SAMConnection::receive</a></div>
 <div class="up"><a href="ref.sam.html">SAM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="samconnection.peekall" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SAMConnection::peekAll</h1>
  <p class="verinfo">(PECL sam &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">SAMConnection::peekAll</span> &mdash; <span class="dc-title">
   Read one or more messages from a queue without removing it from the queue.
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-samconnection.peekall-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>SAMConnection::peekAll</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$target</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$properties</code></span>
  ] )</div>

 </div>


 <div class="refsect1 parameters" id="refsect1-samconnection.peekall-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">target</code></em></span>
     <dd>

      <p class="para">
       The identity of the queue from which messages should be peeked.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">properties</code></em></span>
     <dd>

      <p class="para">
       An optional associative array of properties describing other
       parameters to control the peek operation.
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Property name</th>
           <th>Possible values</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>SAM_CORRELID</td>
           <td>
            This is the target correlation id string of messages to be
            peeked. This would typically have been returned by a &quot;send&quot;
            request.
           </td>
          </tr>

          <tr>
           <td>SAM_MESSAGEID</td>
           <td>
            This is the message id string of a message which is to be peeked.
           </td>
          </tr>
             
         </tbody>
        
       </table>

      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-samconnection.peekall-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   This method returns an array of SAMMessage objects or <strong><code>FALSE</code></strong> if an error
   occurs.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-samconnection.peekall-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-4526">
    <p><strong>Example #1 Retrieve all messages in a queue without removing them</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$msgArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">peekAll</span><span style="color: #007700">(</span><span style="color: #DD0000">'queue://receive/test'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$msgArray</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;foreach&nbsp;(&nbsp;</span><span style="color: #0000BB">$msgArray&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Message&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #DD0000">:&nbsp;body&nbsp;=&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">body</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;}<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"PeekAll&nbsp;failed&nbsp;(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errno</span><span style="color: #DD0000">)&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-4527">
    <p><strong>Example #2 
     Retrieve all messages from a queue with a matching correlation id
    </strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />&nbsp;&nbsp;&nbsp;$msgArray&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">peekAll</span><span style="color: #007700">(</span><span style="color: #DD0000">'queue://receive/test'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #0000BB">SAM_CORRELID&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$correlId&nbsp;</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$msgArray</span><span style="color: #007700">)&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(&nbsp;</span><span style="color: #0000BB">$msgArray&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Message&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #DD0000">:&nbsp;body&nbsp;=&nbsp;</span><span style="color: #0000BB">$msg</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">body</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"PeekAll&nbsp;failed&nbsp;(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errno</span><span style="color: #DD0000">)&nbsp;</span><span style="color: #0000BB">$conn</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">error</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-samconnection.peekall-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="samconnection.peek.html" class="xref">SAMConnection::peek</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="samconnection.peek.html">SAMConnection::peek</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="samconnection.receive.html">SAMConnection::receive</a></div>
 <div class="up"><a href="ref.sam.html">SAM Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>