Re: Pyrus status update
| From: | Greg Beaver | Date: | Mon, 27 Apr 2009 00:37:20 +0000 |
| Subject: | Re: Pyrus status update | ||
| References: | 1 2 | Groups: | php.pear.core |
| Request: | Send a blank email to pear-core+get-8377@lists.php.net to get a copy of this message | ||
Helgi Þormar Þorbjörnsson wrote:
> On Sun, Apr 26, 2009 at 11:10 PM, Greg Beaver <greg@chiaraquartet.net> wrote:
>
> Good job but I have a question about this:
>
>
>> - remote channel iteration API
>> Things like:
>> <?php
>> $channel = PEAR2_Pyrus_Config::current()->channelregistry['pear2.php.net'];
>> foreach ($channel->maintainers as $maintainer) {}
>> foreach ($channel->upgradeable as $package) {}
>> foreach ($channel->packages['stable'] as $package) {}
>> echo $channel->package['PackageName']->version['release'];
>> foreach ($channel->releases['PackageName'] as $package) {
>> echo $package->version['release'],
>> $package->stability['release'];
>> }
>>
>
> This just looks a bit ... well to say it frankly ... Ugly, unusable.
> The array bit anyway, mixing and matching objects and arrays like that
> shouldn't be required when we have ArrayAccess and other SPL om nom
> noms - I would honestly rather want to see $package->version->release
> and so on for this - just saying, that would be what I'd want to use
> if I was 3rd party developer :)
This *is* using ArrayAccess, and is how the packagefile interface works
in Pyrus. See the tests for Pyrus/PackageFile_v2 for the API examples.
There are no mixing/matching of objects/arrays planned.
Greg