Example #1
0
 /**
  * Change the error message generation method from one set in the
  * constructor
  *
  * If later logic requires the use of different error messages for a
  * package, use this static method to change the message generator.
  * @return true|Error_Raise_Error
  * @param string package name
  * @param string|array callback
  * @static
  */
 function setErrorMsgGenerator($package, $errorMsgGenerator)
 {
     if ($errorMsgGenerator) {
         $package = strtolower($package);
         Error_Raise::disableErrorCallbacks();
         $e = Error_Util::_validCallback($errorMsgGenerator);
         Error_Raise::reenableErrorCallbacks();
         if (PEAR::isError($e)) {
             return $e->rePackageError('Error_Raise', 'error', ERROR_RAISE_ERROR_INVALID_ERRMSGGEN, array('package' => $package));
         }
         $GLOBALS['_ERROR_RAISE_MSGS'][$package] = $errorMsgGenerator;
         return true;
     }
 }