Improve on r32014 with a helper function to avoid code duplication/possible inconsist...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 16 Mar 2008 00:50:14 +0000 (00:50 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 16 Mar 2008 00:50:14 +0000 (00:50 +0000)
includes/GlobalFunctions.php
includes/User.php

index 1a90910..71b135f 100644 (file)
@@ -2433,3 +2433,11 @@ function wfMaxlagError( $host, $lag, $maxLag ) {
                echo "Waiting for a database server: $lag seconds lagged\n";
        }
 }
+
+/**
+ * Throws an E_USER_NOTICE saying that $function is deprecated
+ * @param string $function
+ */
+function wfDeprecated( $function ) {
+       trigger_error( "Use of $function is deprecated", E_USER_NOTICE );
+}
index 8e33705..a8bfbe6 100644 (file)
@@ -699,7 +699,7 @@ class User {
         * @deprecated use wfSetupSession()
         */
        function SetupSession() {
-               trigger_error( 'Use of ' . __METHOD__ . ' is deprecated', E_USER_NOTICE );
+               wfDeprecated( __METHOD__ );
                wfSetupSession();
        }
 
@@ -1164,7 +1164,7 @@ class User {
         * @deprecated use User::newFromId()
         */
        function setID( $v ) {
-               trigger_error( 'Use of ' . __METHOD__ . ' is deprecated', E_USER_NOTICE );
+               wfDeprecated( __METHOD__ );
                $this->mId = $v;
                $this->clearInstanceCache( 'id' );
        }
@@ -1760,7 +1760,7 @@ class User {
         * @deprecated
         */
        function isBot() {
-               trigger_error( 'Use of ' . __METHOD__ . ' is deprecated', E_USER_NOTICE );
+               wfDeprecated( __METHOD__ );
                return $this->isAllowed( 'bot' );
        }
 
@@ -2212,7 +2212,7 @@ class User {
         * @deprecated
         */
        function setLoaded( $loaded ) {
-               trigger_error( 'Use of ' . __METHOD__ . ' is deprecated', E_USER_NOTICE );
+               wfDeprecated( __METHOD__ );
        }
 
        /**