<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.yaz.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.yaz-connect.php',
    1 => 'yaz_connect',
    2 => 'Prepares for a connection to a Z39.50 server',
  ),
  'up' => 
  array (
    0 => 'ref.yaz.php',
    1 => 'YAZ Функції',
  ),
  'prev' => 
  array (
    0 => 'function.yaz-close.php',
    1 => 'yaz_close',
  ),
  'next' => 
  array (
    0 => 'function.yaz-database.php',
    1 => 'yaz_database',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaz/functions/yaz-connect.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.yaz-connect" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">yaz_connect</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.1, PECL yaz &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">yaz_connect</span> &mdash; <span class="dc-title">
   Prepares for a connection to a Z39.50 server
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.yaz-connect-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>yaz_connect</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$zurl</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$options</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
   This function returns a connection resource on success, zero on
   failure.
  </p>
  <p class="para">
   <span class="function"><strong>yaz_connect()</strong></span> prepares for a connection to a
   Z39.50 server. 
   This function is non-blocking and does not attempt to establish
   a connection  - it merely prepares a connect to be performed later when
   <span class="function"><a href="function.yaz-wait.php" class="function">yaz_wait()</a></span> is called.
  </p>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    The <a href="http://www.indexdata.dk/yazproxy/" class="link external">&raquo;&nbsp;YAZ proxy</a> is a
    freely available Z39.50 proxy.
   </p>
  </p></blockquote>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.yaz-connect-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">zurl</code></dt>
     <dd>
      <p class="para">
       A string that takes the form <code class="literal">host[:port][/database]</code>.
       If port is omitted, port 210 is used. If database is omitted 
       <code class="literal">Default</code> is used.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       If given as a string, it is treated as the Z39.50 V2 authentication 
       string (OpenAuth).
      </p>
      <p class="para">
       If given as an array, the contents of the array serves as options.
       <dl>
        
         <dt>user</dt>
         <dd>
          <p class="para">
           Username for authentication.
          </p>
         </dd>
        
        
         <dt>group</dt>
         <dd>
          <p class="para">
           Group for authentication.
          </p>
         </dd>
        
        
         <dt>password</dt>
          <dd>
           <p class="para">
            Password for authentication.
           </p>
          </dd>
        
        
         <dt>cookie</dt>
         <dd>
          <p class="para">
           Cookie for session (YAZ proxy).
          </p>
         </dd>
        
        
         <dt>proxy</dt>
         <dd>
          <p class="para">
           Proxy for connection (YAZ proxy).
          </p>
         </dd>
        
        
         <dt>persistent</dt>
         <dd>
          <p class="para">
           A boolean. If <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> the connection is persistent; If <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> the
           connection is not persistent. By default connections are persistent.
          </p>
          <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
           <p class="para">
            If you open a persistent connection, you won&#039;t be able to close 
            it later with <span class="function"><a href="function.yaz-close.php" class="function">yaz_close()</a></span>.
           </p>
          </p></blockquote>
         </dd>
        
        
         <dt>piggyback</dt>
         <dd>
          <p class="para">
           A boolean. If <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> piggyback is enabled for searches; If <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
           piggyback is disabled. By default piggyback is enabled.
          </p>
          <p class="para">
           Enabling piggyback is more efficient and usually saves a 
           network-round-trip for first time fetches of records. However, a 
           few Z39.50 servers do not support piggyback or they ignore element
           set names. For those, piggyback should be disabled.
          </p>
         </dd>
        
        
         <dt>charset</dt>
         <dd>
          <p class="para">
           A string that specifies character set to be used in Z39.50 
           language and character set negotiation. Use strings such as:
           <code class="literal">ISO-8859-1</code>, <code class="literal">UTF-8</code>, 
           <code class="literal">UTF-16</code>.
          </p>
          <p class="para">
           Most Z39.50 servers do not support this feature (and thus, this is
           ignored). Many servers use the ISO-8859-1 encoding for queries and
           messages. MARC21/USMARC records are not affected by this setting.
          </p>
         </dd>
        

        
         <dt>preferredMessageSize</dt>
         <dd>
          <p class="para">
           An integer that specifies the maximum byte size of all records
           to be returned by a target during retrieval. See the
           <a href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.1.1.4" class="link external">&raquo;&nbsp;Z39.50 standard</a> for more
           information.
          </p>
          <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
           <p class="para">
            This option is supported in PECL YAZ 1.0.5 or later.
           </p>
          </p></blockquote>
         </dd>
        

        
         <dt>maximumRecordSize</dt>
         <dd>
          <p class="para">
           An integer that specifies the maximum byte size of a single record
           to be returned by a target during retrieval. This
           entity is referred to as Exceptional-record-size in the
          <a href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.1.1.4" class="link external">&raquo;&nbsp;Z39.50 standard</a>.
          </p>
          <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
           <p class="para">
            This option is supported in PECL YAZ 1.0.5 or later.
           </p>
          </p></blockquote>
         </dd>
        

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

 <div class="refsect1 returnvalues" id="refsect1-function.yaz-connect-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   A connection resource on success, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.yaz-connect-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.yaz-close.php" class="function" rel="rdfs-seeAlso">yaz_close()</a> - Close YAZ connection</span></li>
   </ul>
  </p>
 </div>

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