[PEAR-BUG] Bug #17585 [Opn->Csd]: Pyrus - Channel registry exists bug

[email protected] Fri, 24 Jun 2011 18:35:44 +0100 (BST)
Newsgroups php.pear.doc
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=17585&edit=1

 ID:               17585
 Updated by:       [email protected]
 Reported By:      warnar at dmmw dot nl
 Summary:          Pyrus - Channel registry exists bug
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          Documentation
 Operating System: Windows 7 x64
 PHP Version:      5.3.1
-Assigned To:      
+Assigned To:      mfonda
 Roadmap Versions: 
 New Comment:

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: mfonda
Bug migrated to Pyrus issue tracker on GitHub: see
https://github.com/pear2/PEAR2_Pyrus/issues/35


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

[2010-07-13 12:36:44] boekkooi

Description:
------------
Create a new \PEAR2\Pyrus\Config with a directory that is not yet a
registry. 
Get the channelregistry and check if 'pear2.php.net' exists.

This will return 1.

After this try to get the channel and a exception will be thrown.

Test script:
---------------
$config = PEAR2\Pyrus\Config::singleton('D:\pear\testRepo');

// Expected result false or a exception saying that the channel registry
is not initialized or initialize the registry.
// Current result 1
$res = $config->channelregistry->exists('pear2.php.net'); 
if ($res) {
	echo 'Channel exists ' . PHP_EOL;
} else {
	echo 'Unknow channel' . PHP_EOL;
}

// Throws 'PEAR2\Pyrus\ChannelFile\Exception: Invalid channel.xml'
// This is unexpected behavior
$config->channelregistry->get('pear2.php.net');

Expected result:
----------------
- Make channelregistry->exists return false
or
- Let it throw a exception
or
- Let it initialize the repository

Actual result:
--------------
See test script

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


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=17585&edit=1