php8.5
Home/ Manual/ gnupg / functions/ gnupg_getengineinfo

gnupg_getengineinfo

PHP function Edit on GitHub ✎

(PECL gnupg >= 1.5)

Returns the engine info

Description

gnupg_getengineinfo(resource $identifier): array

Parameters

identifier

Identifier

Return Values

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

Examples

Procedural gnupg_getengineinfo() example

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

The above example will output:

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

OO gnupg_getengineinfo() example

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

The above example will output:

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

Source: reference/gnupg/functions/gnupg-getengineinfo.xml · from the official PHP manual (php/doc-en)