Exemple #1
0
 /**
  * Creates error, same as in PEAR with a customized flavor
  *
  * @param   int                         $code
  * @param   string                      $file
  * @param   int                         $line
  * @return  PEAR_Error
  * @access  private
  */
 function &raiseError($code = SERVICES_WEATHER_ERROR_UNKNOWN_ERROR, $file = "", $line = 0)
 {
     // This should improve the performance of the script, as PEAR is only included, when
     // really needed.
     include_once "PEAR.php";
     $message = "Services_Weather";
     if ($file != "" && $line > 0) {
         $message .= " (" . basename($file) . ":" . $line . ")";
     }
     $message .= ": " . Services_Weather::_errorMessage($code);
     $error = PEAR::raiseError($message, $code, PEAR_ERROR_RETURN, E_USER_NOTICE, "Services_Weather_Error", null, false);
     return $error;
 }