+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* PEAR_ErrorStack and use that framework
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
require_once 'PEAR/ErrorStack.php';
*/
public static function fatal($message = NULL, $code = NULL, $email = NULL) {
$vars = array(
- 'message' => htmlspecialchars($message),
+ 'message' => $message,
'code' => $code,
);
return FALSE;
}
+ /**
+ * Output a deprecated function warning to log file. Deprecated class:function is automatically generated from calling function.
+ *
+ * @param $newMethod
+ * description of new method (eg. "buildOptions() method in the appropriate BAO object").
+ */
+ public static function deprecatedFunctionWarning($newMethod) {
+ $dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ $callerFunction = isset($dbt[1]['function']) ? $dbt[1]['function'] : NULL;
+ $callerClass = isset($dbt[1]['class']) ? $dbt[1]['class'] : NULL;
+ Civi::log()->warning("Deprecated function $callerClass::$callerFunction, use $newMethod.", array('civi.tag' => 'deprecated'));
+ }
+
}
$e = new PEAR_ErrorStack('CRM');