]> git.mjollnir.org Git - moodle.git/commitdiff
nvl() function moved to deprecated - my +1 for removing it together with friends...
authorskodak <skodak>
Sat, 30 Dec 2006 21:05:17 +0000 (21:05 +0000)
committerskodak <skodak>
Sat, 30 Dec 2006 21:05:17 +0000 (21:05 +0000)
lib/deprecatedlib.php
lib/weblib.php

index b4c5c446b3d52068ad4f63ef374906290ac2f063..6860c0344c9cc4c1c0ded2fc331004db455b2b6f 100644 (file)
@@ -74,6 +74,25 @@ function optional_variable(&$var, $default=0) {
     }
 }
 
+/**
+ * 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)) {
+      error( "The nvl() function is deprecated ($var, $default)." );
+    }
+    return isset($var) ? $var : $default;
+}
+
 /**
  * Determines if a user an admin
  *
index 2e5a357402e8c455b70c6ecdb80e3618af238271..e079a47a5e1be4578e7dd9a570af4b724b214f98 100644 (file)
@@ -136,25 +136,6 @@ function p($var, $strip=false) {
 }
 
 
-/**
- * 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)) {
-      error( "The nvl() function is deprecated ($var, $default)." );
-    }
-    return isset($var) ? $var : $default;
-}
-
 /**
  * Remove query string from url
  *