]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14617 remoe optional_varible and friends - YAY!
authorskodak <skodak>
Thu, 1 May 2008 22:07:26 +0000 (22:07 +0000)
committerskodak <skodak>
Thu, 1 May 2008 22:07:26 +0000 (22:07 +0000)
lib/deprecatedlib.php

index 32d1048ec9b0d7c4bc9b8d32ae17675947a11dca..4c368aab6fac095b3a10f14510a4dff18291c05e 100644 (file)
  */
 
 
-
-
-/**
- * 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
  *