<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.gnupg.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.gnupg-init.php',
    1 => 'gnupg_init',
    2 => 'Initialize a connection',
  ),
  'up' => 
  array (
    0 => 'ref.gnupg.php',
    1 => 'GnuPG Функції',
  ),
  'prev' => 
  array (
    0 => 'function.gnupg-import.php',
    1 => 'gnupg_import',
  ),
  'next' => 
  array (
    0 => 'function.gnupg-keyinfo.php',
    1 => 'gnupg_keyinfo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gnupg/functions/gnupg-init.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gnupg-init" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gnupg_init</h1>
  <p class="verinfo">(PECL gnupg &gt;= 0.4)</p><p class="refpurpose"><span class="refname">gnupg_init</span> &mdash; <span class="dc-title">Initialize a connection</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.gnupg-init-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gnupg_init</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.array.php" class="type array">array</a></span></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.gnupg-init-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       Must be an associative array. It is used to change the default configuration
       of the crypto engine.
       <table class="doctable table">
        <caption><strong>Configuration overrides</strong></caption>
        
         <thead>
          <tr>
           <th>key</th>
           <th>type</th>
           <th>description</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>file_name</td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>
            It is the file name of the executable program implementing this protocol
            which is usually path of the <code class="literal">gpg</code> executable.
           </td>
          </tr>

          <tr>
           <td>home_dir</td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>
            It is the directory name of the configuration directory. It also overrides
            <code class="literal">GNUPGHOME</code> environment variable that is used for the same
            purpose.
           </td>
          </tr>

         </tbody>
        
       </table>

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


 <div class="refsect1 returnvalues" id="refsect1-function.gnupg-init-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   A GnuPG <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> connection used by other GnuPG functions.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.gnupg-init-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL gnupg 1.5.0</td>
      <td>The <code class="parameter">options</code> parameter was added.</td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.gnupg-init-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 Procedural <span class="function"><strong>gnupg_init()</strong></span> example with default setting</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$res </span><span style="color: #007700">= </span><span style="color: #0000BB">gnupg_init</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
   <div class="example" id="example-2">
    <p><strong>Приклад #2 Procedural <span class="function"><strong>gnupg_init()</strong></span> example with overriden file name and home dir</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$res </span><span style="color: #007700">= </span><span style="color: #0000BB">gnupg_init</span><span style="color: #007700">([</span><span style="color: #DD0000">"file_name" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"/usr/bin/gpg2"</span><span style="color: #007700">, </span><span style="color: #DD0000">"home_dir" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"/var/www/.gnupg"</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
   <div class="example" id="example-3">
    <p><strong>Приклад #3 OO gnupg initializer example with default setting</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$gpg </span><span style="color: #007700">= new </span><span style="color: #0000BB">gnupg</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
   <div class="example" id="example-4">
    <p><strong>Приклад #4 OO gnupg initializer example with overriden file name and home dir</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$gpg </span><span style="color: #007700">= new </span><span style="color: #0000BB">gnupg</span><span style="color: #007700">([</span><span style="color: #DD0000">"file_name" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"/usr/bin/gpg2"</span><span style="color: #007700">, </span><span style="color: #DD0000">"home_dir" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"/var/www/.gnupg"</span><span style="color: #007700">]);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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

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