<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-dispatcher.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-dispatcher.flushinstantly.php',
    1 => 'Yaf_Dispatcher::flushInstantly',
    2 => 'Switch on/off the instant flushing',
  ),
  'up' => 
  array (
    0 => 'class.yaf-dispatcher.php',
    1 => 'Yaf_Dispatcher',
  ),
  'prev' => 
  array (
    0 => 'yaf-dispatcher.enableview.php',
    1 => 'Yaf_Dispatcher::enableView',
  ),
  'next' => 
  array (
    0 => 'yaf-dispatcher.getapplication.php',
    1 => 'Yaf_Dispatcher::getApplication',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_dispatcher/flushinstantly.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-dispatcher.flushinstantly" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Dispatcher::flushInstantly</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Dispatcher::flushInstantly</span> &mdash; <span class="dc-title">Switch on/off the instant flushing</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-dispatcher.flushinstantly-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Dispatcher::flushInstantly</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$flag</code><span class="initializer"> = null</span></span>): <span class="type"><span class="type"><a href="class.yaf-dispatcher.php" class="type Yaf_Dispatcher">Yaf_Dispatcher</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="simpara">
   Switch on/off instant flushing. When enabled (the default), the
   response body is flushed to the client immediately once it is set by
   <span class="methodname"><a href="yaf-response-abstract.setbody.php" class="methodname">Yaf_Response_Abstract::setBody()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-dispatcher.flushinstantly-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">flag</code></dt>
    <dd>
     <p class="simpara">
      Whether to flush the response body instantly.
     </p>
     <blockquote class="note"><p><strong class="note">Note</strong>: 
      <p class="simpara">
       Since Yaf 2.2.0, if this parameter is not given, the current state
       is returned instead.
      </p>
     </p></blockquote>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-dispatcher.flushinstantly-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns the <span class="classname"><a href="class.yaf-dispatcher.php" class="classname">Yaf_Dispatcher</a></span> object itself when
   <code class="parameter">flag</code> is given, or a <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> indicating the current
   state when it is not.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-dispatcher.flushinstantly-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yaf_Dispatcher::flushInstantly()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$app </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">) . </span><span style="color: #DD0000">"/conf/application.ini"</span><span style="color: #007700">);

</span><span style="color: #0000BB">$dispatcher </span><span style="color: #007700">= </span><span style="color: #0000BB">Yaf_Dispatcher</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance</span><span style="color: #007700">();

</span><span style="color: #FF8000">// Do not flush the response body to the client as soon as it is set
</span><span style="color: #0000BB">$dispatcher</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flushInstantly</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">);

</span><span style="color: #FF8000">// Since Yaf 2.2.0, calling it without arguments queries the current state
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$dispatcher</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flushInstantly</span><span style="color: #007700">());

</span><span style="color: #0000BB">$app</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>The above example will output
something similar to:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(false)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-dispatcher.flushinstantly-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="yaf-dispatcher.returnresponse.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::returnResponse()</a> - Switch on/off returning the response</span></li>
    <li><span class="methodname"><a href="yaf-response-abstract.setbody.php" class="methodname" rel="rdfs-seeAlso">Yaf_Response_Abstract::setBody()</a> - Set content to the response</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>