略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: gnupg_getengineinfo

2024-05-14

gnupg_getengineinfo

(PECL gnupg >= 1.5)

gnupg_getengineinfoReturns the engine info

说明

gnupg_getengineinfo(resource $identifier): array

参数

identifier

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

返回值

Returns an array with engine info consting of protocol, file_name and home_dir.

范例

示例 #1 Procedural gnupg_getengineinfo() example

<?php
$res 
gnupg_init();
print_r(gnupg_getengineinfo($res));
?>

以上例程会输出:

array(3) {
  ["protocol"]=>
  int(0)
  ["file_name"]=>
  string(12) "/usr/bin/gpg"
  ["home_dir"]=>
  string(0) ""
}

示例 #2 OO gnupg_getengineinfo() example

<?php
$gpg 
= new gnupg(["file_name" => "/usr/bin/gpg2""home_dir" => "/var/www/.gnupg"]);
print_r($gpg->getengineinfo());
?>

以上例程会输出:

array(3) {
  ["protocol"]=>
  int(0)
  ["file_name"]=>
  string(13) "/usr/bin/gpg2"
  ["home_dir"]=>
  string(15) "/var/www/.gnupg"
}
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

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

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3