projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #22669 from agileware/CIVICRM-1921
[civicrm-core.git]
/
CRM
/
Core
/
Error.php
diff --git
a/CRM/Core/Error.php
b/CRM/Core/Error.php
index 6c44df6261a3d2dbdf8153874f2fa1140524464f..763a2605d391bc7a979eb4c831467b8a4c37a29d 100644
(file)
--- a/
CRM/Core/Error.php
+++ b/
CRM/Core/Error.php
@@
-242,9
+242,9
@@
class CRM_Core_Error extends PEAR_ErrorStack {
}
/**
}
/**
- *
t
his function is used to return error details
+ *
T
his function is used to return error details
*
*
- * @param $pearError
+ * @param
PEAR_Error
$pearError
*
* @return array $error
*/
*
* @return array $error
*/
@@
-452,7
+452,7
@@
class CRM_Core_Error extends PEAR_ErrorStack {
* so we can interrupt a potential POST/redirect
*
* @param string $name name of debug section
* so we can interrupt a potential POST/redirect
*
* @param string $name name of debug section
- * @param
$variable mixed
reference to variables that we need a trace of
+ * @param
mixed $variable
reference to variables that we need a trace of
* @param bool $log should we log or return the output
* @param bool $html whether to generate a HTML-escaped output
* @param bool $checkPermission should we check permissions before displaying output
* @param bool $log should we log or return the output
* @param bool $html whether to generate a HTML-escaped output
* @param bool $checkPermission should we check permissions before displaying output
@@
-902,9
+902,8
@@
class CRM_Core_Error extends PEAR_ErrorStack {
*
* @param string $status
* The status message to set.
*
* @param string $status
* The status message to set.
- *
- * @param null $redirect
- * @param string $title
+ * @param string|null $redirect
+ * @param string|null $title
*/
public static function statusBounce($status, $redirect = NULL, $title = NULL) {
$session = CRM_Core_Session::singleton();
*/
public static function statusBounce($status, $redirect = NULL, $title = NULL) {
$session = CRM_Core_Session::singleton();
@@
-934,7
+933,7
@@
class CRM_Core_Error extends PEAR_ErrorStack {
/**
* PEAR error-handler which converts errors to exceptions
*
/**
* PEAR error-handler which converts errors to exceptions
*
- * @param $pearError
+ * @param
PEAR_Error
$pearError
* @throws PEAR_Exception
*/
public static function exceptionHandler($pearError) {
* @throws PEAR_Exception
*/
public static function exceptionHandler($pearError) {
@@
-1039,16
+1038,23
@@
class CRM_Core_Error extends PEAR_ErrorStack {
$callerClass = $dbt[1]['class'] ?? NULL;
$oldMethod = "{$callerClass}::{$callerFunction}";
}
$callerClass = $dbt[1]['class'] ?? NULL;
$oldMethod = "{$callerClass}::{$callerFunction}";
}
- self::deprecatedWarning("Deprecated function $oldMethod, use $newMethod.");
+ $message = "Deprecated function $oldMethod, use $newMethod.";
+ Civi::log()->warning($message, ['civi.tag' => 'deprecated']);
+ trigger_error($message, E_USER_DEPRECATED);
}
/**
* Output a deprecated notice about a deprecated call path, rather than deprecating a whole function.
}
/**
* Output a deprecated notice about a deprecated call path, rather than deprecating a whole function.
+ *
* @param string $message
*/
public static function deprecatedWarning($message) {
// Even though the tag is no longer used within the log() function,
// \Civi\API\LogObserver instances may still be monitoring it.
* @param string $message
*/
public static function deprecatedWarning($message) {
// Even though the tag is no longer used within the log() function,
// \Civi\API\LogObserver instances may still be monitoring it.
+ $dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
+ $callerFunction = $dbt[2]['function'] ?? NULL;
+ $callerClass = $dbt[2]['class'] ?? NULL;
+ $message .= " Caller: {$callerClass}::{$callerFunction}";
Civi::log()->warning($message, ['civi.tag' => 'deprecated']);
trigger_error($message, E_USER_DEPRECATED);
}
Civi::log()->warning($message, ['civi.tag' => 'deprecated']);
trigger_error($message, E_USER_DEPRECATED);
}