From c06885114ab45eb1f24ff26e23ab317b8bd7604e Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 21 Apr 2011 19:36:47 +0000 Subject: Fixed a problem with the annotation batch operation test. git-svn-id: http://code.elgg.org/elgg/trunk@9009 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 6c94133df..e9172d184 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1623,8 +1623,9 @@ function is_not_null($string) { * names by singular names. * * @param array $options The options array. $options['keys'] = 'values'; - * @param array $singulars A list of sinular words to pluralize by adding 's'. + * @param array $singulars A list of singular words to pluralize by adding 's'. * + * @access private * @return array * @since 1.7.0 */ -- cgit v1.2.3 From e156208e9d7661aa433abee8e261ed8a9a9749fa Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 22 Apr 2011 21:14:28 +0000 Subject: Added 3rd param to elgg_deprecated_notice() to control how much of the stack to show. git-svn-id: http://code.elgg.org/elgg/trunk@9014 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index e9172d184..8967d9c6c 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1152,13 +1152,16 @@ function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') { * * @see CODING.txt * - * @param str $msg Message to log / display. - * @param str $dep_version Human-readable *release* version: 1.7, 1.7.3 + * @param str $msg Message to log / display. + * @param str $dep_version Human-readable *release* version: 1.7, 1.7.3 + * @param int $backtrace_level How many levels back to display the backtrace. Useful if calling from + * functions that are called from other places (like elgg_view()). Set + * to -1 for a full backtrace. * * @return bool * @since 1.7.0 */ -function elgg_deprecated_notice($msg, $dep_version) { +function elgg_deprecated_notice($msg, $dep_version, $backtrace_level = 1) { // if it's a major release behind, visual and logged // if it's a 1 minor release behind, visual and logged // if it's for current minor release, logged. @@ -1192,9 +1195,26 @@ function elgg_deprecated_notice($msg, $dep_version) { // Get a file and line number for the log. Never show this in the UI. // Skip over the function that sent this notice and see who called the deprecated // function itself. + $msg .= " Called from "; + $stack = array(); $backtrace = debug_backtrace(); - $caller = $backtrace[1]; - $msg .= " (Called from {$caller['file']}:{$caller['line']})"; + // never show this call. + array_shift($backtrace); + $i = count($backtrace); + + foreach ($backtrace as $trace) { + $stack[] = "[#$i] {$trace['file']}:{$trace['line']}"; + $i--; + + if ($backtrace_level > 0) { + if ($backtrace_level <= 1) { + break; + } + $backtrace_level--; + } + } + + $msg .= implode("
-> ", $stack); elgg_log($msg, 'WARNING'); -- cgit v1.2.3 From f232deeb4d3308f6a6482845c80edec0d76f867f Mon Sep 17 00:00:00 2001 From: ewinslow Date: Tue, 26 Apr 2011 16:23:25 +0000 Subject: Fixes some coding standard issues in elgglib.php git-svn-id: http://code.elgg.org/elgg/trunk@9024 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engine/lib/elgglib.php') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 8967d9c6c..e67f8b627 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -202,6 +202,7 @@ function elgg_unregister_js($name) { * * @param string $name Identifier of the JavaScript resource * + * @return void * @since 1.8.0 */ function elgg_load_js($name) { @@ -254,6 +255,7 @@ function elgg_unregister_css($name) { * * @param string $name Identifier of the CSS file * + * @return void * @since 1.8.0 */ function elgg_load_css($name) { @@ -354,8 +356,9 @@ function elgg_unregister_external_file($type, $name) { * Load an external resource for use on this page * * @param string $type Type of file: js or css - * @param string $name + * @param string $name The identifier for the file * + * @return void * @since 1.8.0 */ function elgg_load_external_file($type, $name) { @@ -1765,8 +1768,8 @@ function elgg_css_page_handler($page) { * * //name/of/view.. * - * @param array $page The page array - * @param string $type The type: js or css + * @param array $page The page array + * @param string $type The type: js or css * * @return mixed */ -- cgit v1.2.3