array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.gnupg-init.php', 1 => 'gnupg_init', ), 'up' => array ( 0 => 'ref.gnupg.php', 1 => 'GnuPG İşlevleri', ), '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', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL gnupg >= 0.4)
gnupg_init — Initialize a connection
options
Must be an associative array. It is used to change the default configuration of the crypto engine.
key | type | description |
---|---|---|
file_name | string |
It is the file name of the executable program implementing this protocol
which is usually path of the gpg executable.
|
home_dir | string |
It is the directory name of the configuration directory. It also overrides
GNUPGHOME environment variable that is used for the same
purpose.
|
A GnuPG resource connection used by other GnuPG functions.
Sürüm: | Açıklama |
---|---|
1.5.0 | The options parameter was added. |
Örnek 1 Procedural gnupg_init() example with default setting
<?php
$res = gnupg_init();
?>
Örnek 2 Procedural gnupg_init() example with overriden file name and home dir
<?php
$res = gnupg_init(["file_name" => "/usr/bin/gpg2", "home_dir" => "/var/www/.gnupg"]);
?>
Örnek 3 OO gnupg initializer example with default setting
<?php
$gpg = new gnupg();
?>
Örnek 4 OO gnupg initializer example with overriden file name and home dir
<?php
$gpg = new gnupg(["file_name" => "/usr/bin/gpg2", "home_dir" => "/var/www/.gnupg"]);
?>