GnuPG gnupg_geterrorinfo

(PECL gnupg >= 1.5)

gnupg_geterrorinfo — 오류 정보를 반환합니다.


설명

gnupg_geterrorinfo(resource $identifier): array


매개변수

identifier
gnupg_init() 또는 gnupg에 대한 호출에서 gnupg 식별자입니다.

반환 값

오류 정보가 있는 배열을 반환합니다.


Examples

예제 #1 절차적 gnupg_geterrorinfo() 예제

                  
<?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() 예제

                  
<?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"
}