The definitions of PEAR_ErrorStack::setDefaultCallback() are slightly
different in PEAR 1.9.0 and PEAR 1.10.0. The older one is *implicitly*
static (which, in some deployments of PHP, produces a warning); while the
newer one is *explicitly* static.
This code should work with either signature without warnings.
$log = CRM_Core_Config::getLog();
$this->setLogger($log);
- // set up error handling for Pear Error Stack
- $this->setDefaultCallback(array($this, 'handlePES'));
+ // PEAR<=1.9.0 does not declare "static" properly.
+ if (!is_callable(array('PEAR', '__callStatic'))) {
+ $this->setDefaultCallback(array($this, 'handlePES'));
+ }
+ else {
+ PEAR_ErrorStack::setDefaultCallback(array($this, 'handlePES'));
+ }
}
/**