From ffe45a68aa0907d7d04e6e41e683abf4184f45fb Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 May 2008 22:07:26 +0000 Subject: [PATCH] MDL-14617 remoe optional_varible and friends - YAY! --- lib/deprecatedlib.php | 57 ------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 32d1048ec9..4c368aab6f 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -36,63 +36,6 @@ */ - - -/** - * Ensure that a variable is set - * - * If $var is undefined throw an error, otherwise return $var. - * - * @param mixed $var the variable which may be unset - * @param mixed $default the value to return if $var is unset - */ -function require_variable($var) { - global $CFG; - if (!empty($CFG->disableglobalshack)) { - print_error( 'The require_variable() function is deprecated.' ); - } - if (! isset($var)) { - print_error('A required parameter was missing'); - } -} - -/** - * Ensure that a variable is set - * - * If $var is undefined set it (by reference), otherwise return $var. - * - * @param mixed $var the variable which may be unset - * @param mixed $default the value to return if $var is unset - */ -function optional_variable(&$var, $default=0) { - global $CFG; - if (!empty($CFG->disableglobalshack)) { - print_error( "The optional_variable() function is deprecated ($var, $default)." ); - } - if (! isset($var)) { - $var = $default; - } -} - -/** - * Ensure that a variable is set - * - * Return $var if it is defined, otherwise return $default, - * This function is very similar to {@link optional_variable()} - * - * @param mixed $var the variable which may be unset - * @param mixed $default the value to return if $var is unset - * @return mixed - */ -function nvl(&$var, $default='') { - global $CFG; - - if (!empty($CFG->disableglobalshack)) { - print_error( "The nvl() function is deprecated ($var, $default)." ); - } - return isset($var) ? $var : $default; -} - /** * Determines if a user an admin * -- 2.39.5