<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.eventdnsbase.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'eventdnsbase.construct.php',
    1 => 'EventDnsBase::__construct',
    2 => 'Constructs EventDnsBase object',
  ),
  'up' => 
  array (
    0 => 'class.eventdnsbase.php',
    1 => 'EventDnsBase',
  ),
  'prev' => 
  array (
    0 => 'eventdnsbase.clearsearch.php',
    1 => 'EventDnsBase::clearSearch',
  ),
  'next' => 
  array (
    0 => 'eventdnsbase.countnameservers.php',
    1 => 'EventDnsBase::countNameservers',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/event/eventdnsbase/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="eventdnsbase.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventDnsBase::__construct</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventDnsBase::__construct</span> &mdash; <span class="dc-title">Constructs EventDnsBase object</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventdnsbase.construct-description">
  <h3 class="title">说明</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>EventDnsBase::__construct</strong></span>(<span class="methodparam">
    
    <span class="type"><a href="class.eventbase.php" class="type EventBase">EventBase</a></span> <code class="parameter">$base</code>
   </span>, <span class="methodparam">
    
    <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$initialize</code>
   </span>)</div>

  <p class="para rdfs-comment">
   Constructs EventDnsBase object.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventdnsbase.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
     <code class="parameter">base</code>
    </dt>
    <dd>
     <p class="para">
      Event base.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">initialize</code>
    </dt>
    <dd>
     <p class="para">
      If <code class="parameter">initialize</code> is <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>,
      it attempts to use the underlying operating system defaults to configure
      the DNS base senibly.
      If it is <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, the DNS base is left unconfigured, with no nameservers or options set.
      In the latter case the DNS base should be configured manually, e.g. with
      <span class="methodname"><a href="eventdnsbase.parseresolvconf.php" class="methodname">EventDnsBase::parseResolvConf()</a></span>.
     </p>
     <p class="para">
      If <code class="parameter">initialize</code> is an integer, it must be one of the following flags:
      <table class="doctable informaltable">
       
        <thead>
         <tr>
          <th>Flag</th>
          <th>说明</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td style="vertical-align: top;"><strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.disable-when-inactive">EventDnsBase::DISABLE_WHEN_INACTIVE</a></code></strong></td>
          <td style="vertical-align: top;">
           Do not prevent the libevent event loop from exiting when we have no active DNS requests.
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;"><strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.initialize-nameservers">EventDnsBase::INITIALIZE_NAMESERVERS</a></code></strong></td>
          <td style="vertical-align: top;">
           Process the <code class="literal">resolv.conf</code>.
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;"><strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.nameservers-no-default">EventDnsBase::NAMESERVERS_NO_DEFAULT</a></code></strong></td>
          <td style="vertical-align: top;">
           Do not add default nameserver if there are no nameservers in the <code class="literal">resolv.conf</code>.
          </td>
         </tr>

        </tbody>
       
      </table>

     </p>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 errors" id="refsect1-eventdnsbase.construct-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   If <code class="parameter">initialize</code> has a type other than
   <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span>,
   a <span class="exceptionname"><a href="class.typeerror.php" class="exceptionname">TypeError</a></span> is thrown.
  </p>
  <p class="para">
   If the value of <code class="parameter">initialize</code> is invalid,
   a <span class="exceptionname"><a href="class.eventexception.php" class="exceptionname">EventException</a></span> is thrown.
  </p>
 </div>

 <div class="refsect1 changelog" id="refsect1-eventdnsbase.construct-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL event 3.1.3</td>
      <td>
       If <code class="parameter">initialize</code> has a type other than
       <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span>,
       a <span class="exceptionname"><a href="class.typeerror.php" class="exceptionname">TypeError</a></span> is thrown.
      </td>
     </tr>

     <tr>
      <td>PECL event 3.1.0RC1</td>
      <td>
       The type of the <code class="parameter">initialize</code> parameter has been changed from <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>
       to <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span>. The value can be either <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> (preserving the previous meaning)
       or one of the following constants:
       <strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.disable-when-inactive">EventDnsBase::DISABLE_WHEN_INACTIVE</a></code></strong>,
       <strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.initialize-nameservers">EventDnsBase::INITIALIZE_NAMESERVERS</a></code></strong>,
       or <strong><code><a href="class.eventdnsbase.php#eventdnsbase.constants.nameservers-no-default">EventDnsBase::NAMESERVERS_NO_DEFAULT</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

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