Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: gnupg_geterrorinfo - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: gnupg_geterrorinfo

2025-05-13

gnupg_geterrorinfo

(PECL gnupg >= 1.5)

gnupg_geterrorinfoReturns the error info

说明

gnupg_geterrorinfo(resource $identifier): array

参数

identifier

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

返回值

Returns an array with error info.

示例

示例 #1 Procedural gnupg_geterrorinfo() example

<?php
$res
= gnupg_init();
// this is called without any error
print_r(gnupg_geterrorinfo($res));
?>

以上示例会输出:

array(4) {
  ["generic_message"]=>
  bool(false)
  ["gpgme_code"]=>
  int(0)
  ["gpgme_source"]=>
  string(18) "Unspecified source"
  ["gpgme_message"]=>
  string(7) "Success"
}

示例 #2 OO gnupg_geterrorinfo() example

<?php
$gpg
= new gnupg();
// error call
$gpg->decrypt('abc');
// error info should be displayed
print_r($gpg->geterrorinfo());
?>

以上示例会输出:

array(4) {
  ["generic_message"]=>
  string(14) "decrypt failed"
  ["gpgme_code"]=>
  int(117440570)
  ["gpgme_source"]=>
  string(5) "GPGME"
  ["gpgme_message"]=>
  string(7) "No data"
}
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/function.gnupg-geterrorinfo.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3