Merge "(bug 47070) check content model namespace on import."
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 5d3a4d8..2dda695 100644 (file)
@@ -1340,19 +1340,6 @@ function wfGetLangObj( $langcode = false ) {
        return $wgContLang;
 }
 
-/**
- * Old function when $wgBetterDirectionality existed
- * All usage removed, wfUILang can be removed in near future
- *
- * @deprecated since 1.18
- * @return Language
- */
-function wfUILang() {
-       wfDeprecated( __METHOD__, '1.18' );
-       global $wgLang;
-       return $wgLang;
-}
-
 /**
  * This is the function for getting translated interface messages.
  *
@@ -1622,18 +1609,19 @@ function wfMsgWikiHtml( $key ) {
  * @deprecated since 1.18
  *
  * @param string $key key of the message
- * @param array $options processing rules. Can take the following options:
- *   <i>parse</i>: parses wikitext to HTML
- *   <i>parseinline</i>: parses wikitext to HTML and removes the surrounding
+ * @param array $options processing rules.
+ *   Can take the following options:
+ *     parse: parses wikitext to HTML
+ *     parseinline: parses wikitext to HTML and removes the surrounding
  *       p's added by parser or tidy
- *   <i>escape</i>: filters message through htmlspecialchars
- *   <i>escapenoentities</i>: same, but allows entity references like &#160; through
- *   <i>replaceafter</i>: parameters are substituted after parsing or escaping
- *   <i>parsemag</i>: transform the message using magic phrases
- *   <i>content</i>: fetch message for content language instead of interface
- * Also can accept a single associative argument, of the form 'language' => 'xx':
- *   <i>language</i>: Language object or language code to fetch message for
- *       (overridden by <i>content</i>).
+ *     escape: filters message through htmlspecialchars
+ *     escapenoentities: same, but allows entity references like &#160; through
+ *     replaceafter: parameters are substituted after parsing or escaping
+ *     parsemag: transform the message using magic phrases
+ *     content: fetch message for content language instead of interface
+ *   Also can accept a single associative argument, of the form 'language' => 'xx':
+ *     language: Language object or language code to fetch message for
+ *       (overridden by content).
  * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
  *
  * @return String
@@ -2618,25 +2606,6 @@ function wfPercent( $nr, $acc = 2, $round = true ) {
        return $round ? round( $ret, $acc ) . '%' : "$ret%";
 }
 
-/**
- * Find out whether or not a mixed variable exists in a string
- *
- * @deprecated Just use str(i)pos
- * @param $needle String
- * @param $str String
- * @param $insensitive Boolean
- * @return Boolean
- */
-function in_string( $needle, $str, $insensitive = false ) {
-       wfDeprecated( __METHOD__, '1.21' );
-       $func = 'strpos';
-       if ( $insensitive ) {
-               $func = 'stripos';
-       }
-
-       return $func( $str, $needle ) !== false;
-}
-
 /**
  * Safety wrapper around ini_get() for boolean settings.
  * The values returned from ini_get() are pre-normalized for settings
@@ -3711,15 +3680,6 @@ function wfLocalFile( $title ) {
        return RepoGroup::singleton()->getLocalRepo()->newFile( $title );
 }
 
-/**
- * Stream a file to the browser. Back-compat alias for StreamFile::stream()
- * @deprecated since 1.19
- */
-function wfStreamFile( $fname, $headers = array() ) {
-       wfDeprecated( __FUNCTION__, '1.19' );
-       StreamFile::stream( $fname, $headers );
-}
-
 /**
  * Should low-performance queries be disabled?
  *
@@ -3847,23 +3807,6 @@ function wfCountDown( $n ) {
        echo "\n";
 }
 
-/**
- * Generate a random 32-character hexadecimal token.
- * @param $salt Mixed: some sort of salt, if necessary, to add to random
- *              characters before hashing.
- * @return string
- * @codeCoverageIgnore
- * @deprecated since 1.20; Please use MWCryptRand for security purposes and
- * wfRandomString for pseudo-random strings
- * @warning This method is NOT secure. Additionally it has many callers that
- * use it for pseudo-random purposes.
- */
-function wfGenerateToken( $salt = '' ) {
-       wfDeprecated( __METHOD__, '1.20' );
-       $salt = serialize( $salt );
-       return md5( mt_rand( 0, 0x7fffffff ) . $salt );
-}
-
 /**
  * Replace all invalid characters with -
  * Additional characters can be defined in $wgIllegalFileChars (see bug 20489)
@@ -4025,10 +3968,12 @@ function wfGetLangConverterCacheStorage() {
  *
  * @param string $event event name
  * @param array $args parameters passed to hook functions
+ * @param string|null $deprecatedVersion optionally mark hook as deprecated with version number
+ *
  * @return Boolean True if no handler aborted the hook
  */
-function wfRunHooks( $event, array $args = array() ) {
-       return Hooks::run( $event, $args );
+function wfRunHooks( $event, array $args = array(), $deprecatedVersion = null ) {
+       return Hooks::run( $event, $args, $deprecatedVersion );
 }
 
 /**