fabpot/Pirum — Issue #33: Regression on 1.0.4 with added support for PEAR Optional Dependency Groups 
Author: llaville
Created: 2011-10-16 14:37:50+00:00
State: open

Hello Fabien,

I've just upgrade my local version of pirum from 1.0.3 to 1.0.4 and tried to re-build a new fresh PEAR server (for my channel bartlett.laurent-laville.org).

I got a FATAL error when attempt to add PHP_Reflect 0.1.0.

Here are error message i saw in my log
PHP Fatal error: Call to undefined method SimpleXMLElement::count() in C:\UwAmp\bin\php\php-5.2.17\pirum on line 1221

I investigated and see that commit that introduced the new feature
https://github.com/fabpot/Pirum/commit/7991f36a754a90ffef6eaa8cd1ff3d7d60e703a7
is partial.

I suggest, in major case when there are no dependencies group, to replace code as below :

Line 1221
https://github.com/fabpot/Pirum/blob/master/pirum#L1221

if ($this->package->dependencies->group->count() > 0) {

By line

if (isset($this->package->dependencies->group) && $this->package->dependencies->group->count() > 0) {

Regards
Laurent Laville