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

ID: 17592
Updated by: brett.bieber@gmail.com
Reported By: warnar at dmmw dot nl
Summary: Pyrus: \PEAR2\Pyrus\Package exception
Status: Open
Type: Bug
Package: PEAR
Operating System: Windows 7 x64
PHP Version: 5.3.1
Roadmap Versions:
New Comment:

Hmm, I think in this case the exception is to be expected.

To retrieve information about remote packages, pass $forceremote = true
to Package::__construct so it won't look at the local registry before
comparing against remote packages.


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

[2010-07-14 15:00:55] boekkooi

Description:
------------
When creating a new instance of a package that is all ready in the
rgistry a exception occures.

Test script:
---------------
<?php
require_once 'PEAR2\Autoload.php';
\PEAR2\Pyrus\Config::setCurrent('d:/pear/testRepo');

// The will work like a charm
$pkg = new \PEAR2\Pyrus\Package('pear2.php.net/PEAR2_Pyrus');

// This will throw a 'PEAR2\Pyrus\Package\InstalledException'
$pkg = new \PEAR2\Pyrus\Package('pear2.php.net/PEAR2_Pyrus-2.0.0a1');

Expected result:
----------------
- No exception (since the Package object can also be used to retrieve
information).

Actual result:
--------------
Fatal error: Uncaught exception 'PEAR2\Pyrus\Package\InstalledException'
with message 'channel://pear2.php.net/PEAR2_Pyrus-2.0.0a1 is already
installed and is newer than detected release version 2.0.0a1' in
D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php:282
Stack trace:
#0 D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php(47):
PEAR2\Pyrus\Package\Remote->fromString('pear2.php.net/P...')
#1 D:\pear\repo\php\PEAR2\Pyrus\Package.php(55):
PEAR2\Pyrus\Package\Remote->__construct('pear2.php.net/P...',
Object(PEAR2\Pyrus\Package))
#2 D:\pear\packages\PackageManager\tests\u.php(7):
PEAR2\Pyrus\Package->__construct('pear2.php.net/P...')
#3 {main}
thrown in D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php on line 282

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

Search Discussions

  • Warnar at Jul 19, 2010 at 9:19 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17592&edit=1

    ID: 17592
    Updated by: warnar@dmmw.nl
    Reported By: warnar at dmmw dot nl
    Summary: Pyrus: \PEAR2\Pyrus\Package exception
    Status: Open
    Type: Bug
    Package: PEAR
    Operating System: Windows 7 x64
    PHP Version: 5.3.1
    Roadmap Versions:
    New Comment:

    Okee so what your saying is don't use Package for getting information
    about a package that's allready installed? but use Registry::package and
    Registry::exists?


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

    [2010-07-16 21:08:19] saltybeagle

    Hmm, I think in this case the exception is to be expected.

    To retrieve information about remote packages, pass $forceremote = true
    to Package::__construct so it won't look at the local registry before
    comparing against remote packages.

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

    [2010-07-14 15:00:55] boekkooi

    Description:
    ------------
    When creating a new instance of a package that is all ready in the
    rgistry a exception occures.

    Test script:
    ---------------
    <?php
    require_once 'PEAR2\Autoload.php';
    \PEAR2\Pyrus\Config::setCurrent('d:/pear/testRepo');

    // The will work like a charm
    $pkg = new \PEAR2\Pyrus\Package('pear2.php.net/PEAR2_Pyrus');

    // This will throw a 'PEAR2\Pyrus\Package\InstalledException'
    $pkg = new \PEAR2\Pyrus\Package('pear2.php.net/PEAR2_Pyrus-2.0.0a1');

    Expected result:
    ----------------
    - No exception (since the Package object can also be used to retrieve
    information).

    Actual result:
    --------------
    Fatal error: Uncaught exception 'PEAR2\Pyrus\Package\InstalledException'
    with message 'channel://pear2.php.net/PEAR2_Pyrus-2.0.0a1 is already
    installed and is newer than detected release version 2.0.0a1' in
    D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php:282
    Stack trace:
    #0 D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php(47):
    PEAR2\Pyrus\Package\Remote->fromString('pear2.php.net/P...')
    #1 D:\pear\repo\php\PEAR2\Pyrus\Package.php(55):
    PEAR2\Pyrus\Package\Remote->__construct('pear2.php.net/P...',
    Object(PEAR2\Pyrus\Package))
    #2 D:\pear\packages\PackageManager\tests\u.php(7):
    PEAR2\Pyrus\Package->__construct('pear2.php.net/P...')
    #3 {main}
    thrown in D:\pear\repo\php\PEAR2\Pyrus\Package\Remote.php on line 282

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 16, '10 at 9:08p
activeJul 19, '10 at 9:19a
posts2
users2
websitepear.php.net

2 users in discussion

Warnar: 1 post Brett Bieber: 1 post

People

Translate

site design / logo © 2022 Grokbase