array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.gnupg-getprotocol.php', 1 => 'gnupg_getprotocol', 2 => 'Returns the currently active protocol for all operations', ), 'up' => array ( 0 => 'ref.gnupg.php', 1 => 'GnuPG 函数', ), 'prev' => array ( 0 => 'function.gnupg-geterrorinfo.php', 1 => 'gnupg_geterrorinfo', ), 'next' => array ( 0 => 'function.gnupg-gettrustlist.php', 1 => 'gnupg_gettrustlist', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/gnupg/functions/gnupg-getprotocol.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

gnupg_getprotocol

(PECL gnupg >= 0.1)

gnupg_getprotocolReturns the currently active protocol for all operations

说明

gnupg_getprotocol(resource $identifier): int

参数

identifier

gnupg 标识符,由对 gnupg_init()gnupg 的调用生成。

返回值

Returns the currently active protocol, which can be one of GNUPG_PROTOCOL_OpenPGP or GNUPG_PROTOCOL_CMS.

示例

示例 #1 Procedural gnupg_getprotocol() example

<?php
$res
= gnupg_init();
echo
gnupg_getprotocol($res);
?>

示例 #2 OO gnupg_getprotocol() example

<?php
$gpg
= new gnupg();
echo
$gpg->getprotocol();
?>