FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17628&edit=1

ID: 17628
Updated by: alec@alec.pl
Reported By: steves at splicer dot com
Summary: Uncaught exception
Status: Open
Type: Bug
Package: Crypt_GPG
Operating System: OS X 10.5.8
Package Version: 1.1.1
PHP Version: 5.2.12
Roadmap Versions:
New Comment:

I don't see a reason to use explode there. Proposed change:
--- Engine.old 2010-08-20 09:27:04.818725258 +0200


+++ Engine.php 2010-08-20 10:54:01.035194377 +0200


@@ -837,11 +837,9 @@


$code);


}





- $info = explode(PHP_EOL, $info);


- $matches = array();


- $expression = '/^gpg \(GnuPG\) (.*)$/';


+ $expression = '/^gpg \(GnuPG\) (\S+)/';





- if (preg_match($expression, $info[0], $matches) === 1) {


+ if (preg_match($expression, $info, $matches) === 1) {


$this->_version = $matches[1];


} else {


throw new Crypt_GPG_Exception(


Previous Comments:
------------------------------------------------------------------------

[2010-07-26 15:04:46] gauthierm

Hi Steven,

Are you using MAMP from www.mamp.info, or just with the tools provided
by stock
OS X?

I'm not able to reproduce the issue using my 1.4.10 version of Crypt_GPG
in
Ubuntu 10.04.

Can you do a dump of gpg --version and attach it to this bug so I can
investigate
further? I'm suspicious the line breaks are not equal to PHP_EOL.

$gpg --version > gpg-version-dump

------------------------------------------------------------------------

[2010-07-23 23:11:13] smscotten

Description:
------------
Result (below) is what I get in a stock MAMP environment (php.ini
modified only to add the library path for PEAR packages)

If I run 'usr/local/bin/gpg --help' the first line returned is:

gpg (GnuPG) 1.4.10

So I'm pretty sure it's really GnuPG.

Test script:
---------------
<?php
require_once('Crypt/GPG.php');
$gnupg = new Crypt_GPG();
$gnupg->addDecryptKey('KEY GOES HERE');
?>

Expected result:
----------------
nothing at all.

Actual result:
--------------
Fatal error: Uncaught Crypt_GPG_Exception: No GnuPG version information
provided by the binary "/usr/local/bin/gpg". Are you sure it is GnuPG?
in /usr/lib/php/Crypt/GPG/Engine.php on line 1391

Exception trace #

Function
Location
0 Crypt_GPG_Engine->getVersion() /usr/lib/php/Crypt/GPG/Engine.php:1391
1 Crypt_GPG_Engine->_openSubprocess()
/usr/lib/php/Crypt/GPG/Engine.php:689
2 Crypt_GPG_Engine->run() /usr/lib/php/Crypt/GPG.php:722
3 Crypt_GPG->getKeys('[BEGINNING OF KEY]…') /usr/lib/php/Crypt in
/usr/lib/php/Crypt/GPG/Engine.php on line 847

------------------------------------------------------------------------

Search Discussions

  • Alec at Aug 20, 2010 at 8:56 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17628&edit=1

    ID: 17628
    Updated by: alec@alec.pl
    Reported By: steves at splicer dot com
    Summary: Uncaught exception
    Status: Open
    Type: Bug
    Package: Crypt_GPG
    Operating System: OS X 10.5.8
    Package Version: 1.1.1
    PHP Version: 5.2.12
    Roadmap Versions:
    New Comment:

    Sorry, better formatting:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200
    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200
    @@ -837,11 +837,9 @@
    $code);
    }

    - $info = explode(PHP_EOL, $info);
    - $matches = array();
    - $expression = '/^gpg \(GnuPG\) (.*)$/';
    + $expression = '/^gpg \(GnuPG\) (\S+)/';

    - if (preg_match($expression, $info[0], $matches) === 1) {
    + if (preg_match($expression, $info, $matches) === 1) {
    $this->_version = $matches[1];
    } else {
    throw new Crypt_GPG_Exception(


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-08-20 08:55:14] alec

    I don't see a reason to use explode there. Proposed change:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200


    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200


    @@ -837,11 +837,9 @@


    $code);


    }





    - $info = explode(PHP_EOL, $info);


    - $matches = array();


    - $expression = '/^gpg \(GnuPG\) (.*)$/';


    + $expression = '/^gpg \(GnuPG\) (\S+)/';





    - if (preg_match($expression, $info[0], $matches) === 1) {


    + if (preg_match($expression, $info, $matches) === 1) {


    $this->_version = $matches[1];


    } else {


    throw new Crypt_GPG_Exception(

    ------------------------------------------------------------------------

    [2010-07-26 15:04:46] gauthierm

    Hi Steven,

    Are you using MAMP from www.mamp.info, or just with the tools provided
    by stock
    OS X?

    I'm not able to reproduce the issue using my 1.4.10 version of Crypt_GPG
    in
    Ubuntu 10.04.

    Can you do a dump of gpg --version and attach it to this bug so I can
    investigate
    further? I'm suspicious the line breaks are not equal to PHP_EOL.

    $gpg --version > gpg-version-dump

    ------------------------------------------------------------------------

    [2010-07-23 23:11:13] smscotten

    Description:
    ------------
    Result (below) is what I get in a stock MAMP environment (php.ini
    modified only to add the library path for PEAR packages)

    If I run 'usr/local/bin/gpg --help' the first line returned is:

    gpg (GnuPG) 1.4.10

    So I'm pretty sure it's really GnuPG.

    Test script:
    ---------------
    <?php
    require_once('Crypt/GPG.php');
    $gnupg = new Crypt_GPG();
    $gnupg->addDecryptKey('KEY GOES HERE');
    ?>

    Expected result:
    ----------------
    nothing at all.

    Actual result:
    --------------
    Fatal error: Uncaught Crypt_GPG_Exception: No GnuPG version information
    provided by the binary "/usr/local/bin/gpg". Are you sure it is GnuPG?
    in /usr/lib/php/Crypt/GPG/Engine.php on line 1391

    Exception trace #

    Function
    Location
    0 Crypt_GPG_Engine->getVersion() /usr/lib/php/Crypt/GPG/Engine.php:1391
    1 Crypt_GPG_Engine->_openSubprocess()
    /usr/lib/php/Crypt/GPG/Engine.php:689
    2 Crypt_GPG_Engine->run() /usr/lib/php/Crypt/GPG.php:722
    3 Crypt_GPG->getKeys('[BEGINNING OF KEY]…') /usr/lib/php/Crypt in
    /usr/lib/php/Crypt/GPG/Engine.php on line 847

    ------------------------------------------------------------------------
  • Alec at Aug 20, 2010 at 8:58 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17628&edit=1

    ID: 17628
    Updated by: alec@alec.pl
    Reported By: steves at splicer dot com
    Summary: Uncaught exception
    Status: Open
    Type: Bug
    Package: Crypt_GPG
    Operating System: OS X 10.5.8
    Package Version: 1.1.1
    PHP Version: 5.2.12
    Roadmap Versions:
    New Comment:

    Now I think we could even use '/gpg \(GnuPG\) (\S+)/' instead.


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-08-20 08:55:57] alec

    Sorry, better formatting:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200
    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200
    @@ -837,11 +837,9 @@
    $code);
    }

    - $info = explode(PHP_EOL, $info);
    - $matches = array();
    - $expression = '/^gpg \(GnuPG\) (.*)$/';
    + $expression = '/^gpg \(GnuPG\) (\S+)/';

    - if (preg_match($expression, $info[0], $matches) === 1) {
    + if (preg_match($expression, $info, $matches) === 1) {
    $this->_version = $matches[1];
    } else {
    throw new Crypt_GPG_Exception(

    ------------------------------------------------------------------------

    [2010-08-20 08:55:14] alec

    I don't see a reason to use explode there. Proposed change:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200


    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200


    @@ -837,11 +837,9 @@


    $code);


    }





    - $info = explode(PHP_EOL, $info);


    - $matches = array();


    - $expression = '/^gpg \(GnuPG\) (.*)$/';


    + $expression = '/^gpg \(GnuPG\) (\S+)/';





    - if (preg_match($expression, $info[0], $matches) === 1) {


    + if (preg_match($expression, $info, $matches) === 1) {


    $this->_version = $matches[1];


    } else {


    throw new Crypt_GPG_Exception(

    ------------------------------------------------------------------------

    [2010-07-26 15:04:46] gauthierm

    Hi Steven,

    Are you using MAMP from www.mamp.info, or just with the tools provided
    by stock
    OS X?

    I'm not able to reproduce the issue using my 1.4.10 version of Crypt_GPG
    in
    Ubuntu 10.04.

    Can you do a dump of gpg --version and attach it to this bug so I can
    investigate
    further? I'm suspicious the line breaks are not equal to PHP_EOL.

    $gpg --version > gpg-version-dump

    ------------------------------------------------------------------------

    [2010-07-23 23:11:13] smscotten

    Description:
    ------------
    Result (below) is what I get in a stock MAMP environment (php.ini
    modified only to add the library path for PEAR packages)

    If I run 'usr/local/bin/gpg --help' the first line returned is:

    gpg (GnuPG) 1.4.10

    So I'm pretty sure it's really GnuPG.

    Test script:
    ---------------
    <?php
    require_once('Crypt/GPG.php');
    $gnupg = new Crypt_GPG();
    $gnupg->addDecryptKey('KEY GOES HERE');
    ?>

    Expected result:
    ----------------
    nothing at all.

    Actual result:
    --------------
    Fatal error: Uncaught Crypt_GPG_Exception: No GnuPG version information
    provided by the binary "/usr/local/bin/gpg". Are you sure it is GnuPG?
    in /usr/lib/php/Crypt/GPG/Engine.php on line 1391

    Exception trace #

    Function
    Location
    0 Crypt_GPG_Engine->getVersion() /usr/lib/php/Crypt/GPG/Engine.php:1391
    1 Crypt_GPG_Engine->_openSubprocess()
    /usr/lib/php/Crypt/GPG/Engine.php:689
    2 Crypt_GPG_Engine->run() /usr/lib/php/Crypt/GPG.php:722
    3 Crypt_GPG->getKeys('[BEGINNING OF KEY]…') /usr/lib/php/Crypt in
    /usr/lib/php/Crypt/GPG/Engine.php on line 847

    ------------------------------------------------------------------------
  • Mike at Aug 20, 2010 at 2:41 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=17628&edit=1

    ID: 17628
    Updated by: mike@silverorange.com
    Reported By: steves at splicer dot com
    Summary: Uncaught exception
    -Status: Open
    +Status: Feedback
    Type: Bug
    Package: Crypt_GPG
    Operating System: OS X 10.5.8
    Package Version: 1.1.1
    PHP Version: 5.2.12
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback
    I applied this change in revision 302559.

    http://svn.php.net/viewvc?view=revision&revision=302559

    I'm not sure if it will fix the original bug as I was unable to
    reproduce the original bug.

    Steven, can you try applying this patch to your copy of Crypt_GPG and
    see if it works
    properly on your MAMP install?


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-08-20 08:58:56] alec

    Now I think we could even use '/gpg \(GnuPG\) (\S+)/' instead.

    ------------------------------------------------------------------------

    [2010-08-20 08:55:57] alec

    Sorry, better formatting:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200
    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200
    @@ -837,11 +837,9 @@
    $code);
    }

    - $info = explode(PHP_EOL, $info);
    - $matches = array();
    - $expression = '/^gpg \(GnuPG\) (.*)$/';
    + $expression = '/^gpg \(GnuPG\) (\S+)/';

    - if (preg_match($expression, $info[0], $matches) === 1) {
    + if (preg_match($expression, $info, $matches) === 1) {
    $this->_version = $matches[1];
    } else {
    throw new Crypt_GPG_Exception(

    ------------------------------------------------------------------------

    [2010-08-20 08:55:14] alec

    I don't see a reason to use explode there. Proposed change:
    --- Engine.old 2010-08-20 09:27:04.818725258 +0200


    +++ Engine.php 2010-08-20 10:54:01.035194377 +0200


    @@ -837,11 +837,9 @@


    $code);


    }





    - $info = explode(PHP_EOL, $info);


    - $matches = array();


    - $expression = '/^gpg \(GnuPG\) (.*)$/';


    + $expression = '/^gpg \(GnuPG\) (\S+)/';





    - if (preg_match($expression, $info[0], $matches) === 1) {


    + if (preg_match($expression, $info, $matches) === 1) {


    $this->_version = $matches[1];


    } else {


    throw new Crypt_GPG_Exception(

    ------------------------------------------------------------------------

    [2010-07-26 15:04:46] gauthierm

    Hi Steven,

    Are you using MAMP from www.mamp.info, or just with the tools provided
    by stock
    OS X?

    I'm not able to reproduce the issue using my 1.4.10 version of Crypt_GPG
    in
    Ubuntu 10.04.

    Can you do a dump of gpg --version and attach it to this bug so I can
    investigate
    further? I'm suspicious the line breaks are not equal to PHP_EOL.

    $gpg --version > gpg-version-dump

    ------------------------------------------------------------------------

    [2010-07-23 23:11:13] smscotten

    Description:
    ------------
    Result (below) is what I get in a stock MAMP environment (php.ini
    modified only to add the library path for PEAR packages)

    If I run 'usr/local/bin/gpg --help' the first line returned is:

    gpg (GnuPG) 1.4.10

    So I'm pretty sure it's really GnuPG.

    Test script:
    ---------------
    <?php
    require_once('Crypt/GPG.php');
    $gnupg = new Crypt_GPG();
    $gnupg->addDecryptKey('KEY GOES HERE');
    ?>

    Expected result:
    ----------------
    nothing at all.

    Actual result:
    --------------
    Fatal error: Uncaught Crypt_GPG_Exception: No GnuPG version information
    provided by the binary "/usr/local/bin/gpg". Are you sure it is GnuPG?
    in /usr/lib/php/Crypt/GPG/Engine.php on line 1391

    Exception trace #

    Function
    Location
    0 Crypt_GPG_Engine->getVersion() /usr/lib/php/Crypt/GPG/Engine.php:1391
    1 Crypt_GPG_Engine->_openSubprocess()
    /usr/lib/php/Crypt/GPG/Engine.php:689
    2 Crypt_GPG_Engine->run() /usr/lib/php/Crypt/GPG.php:722
    3 Crypt_GPG->getKeys('[BEGINNING OF KEY]…') /usr/lib/php/Crypt in
    /usr/lib/php/Crypt/GPG/Engine.php on line 847

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 20, '10 at 8:55a
activeAug 20, '10 at 2:41p
posts4
users2
websitepear.php.net

2 users in discussion

Alec: 3 posts Mike: 1 post

People

Translate

site design / logo © 2022 Grokbase