Simplified and fixed pear/pecl logic.