Fix r79494: Don't prefix functions now that they're in their own class
authorX! <soxred93@users.mediawiki.org>
Tue, 4 Jan 2011 01:44:11 +0000 (01:44 +0000)
committerX! <soxred93@users.mediawiki.org>
Tue, 4 Jan 2011 01:44:11 +0000 (01:44 +0000)
includes/Fallback.php
includes/GlobalFunctions.php
tests/phpunit/includes/GlobalTest.php

index 422ea8a..06dc9e7 100644 (file)
@@ -23,7 +23,7 @@
  */
 class Fallback {
        
-       public static function fallback_iconv( $from, $to, $string ) {
+       public static function iconv( $from, $to, $string ) {
                if ( substr( $to, -8 ) == '//IGNORE' ) {
                        $to = substr( $to, 0, strlen( $to ) - 8 );
                }
@@ -49,21 +49,21 @@ class Fallback {
         * can be up to 100x slower than native if the text is heavily
         * multibyte and we have to slog through a few hundred kb.
         */
-       public static function fallback_mb_substr( $str, $start, $count='end' ) {
+       public static function mb_substr( $str, $start, $count='end' ) {
                if( $start != 0 ) {
-                       $split = self::fallback_mb_substr_split_unicode( $str, intval( $start ) );
+                       $split = self::mb_substr_split_unicode( $str, intval( $start ) );
                        $str = substr( $str, $split );
                }
        
                if( $count !== 'end' ) {
-                       $split = self::fallback_mb_substr_split_unicode( $str, intval( $count ) );
+                       $split = self::mb_substr_split_unicode( $str, intval( $count ) );
                        $str = substr( $str, 0, $split );
                }
        
                return $str;
        }
        
-       public static function fallback_mb_substr_split_unicode( $str, $splitPos ) {
+       public static function mb_substr_split_unicode( $str, $splitPos ) {
                if( $splitPos == 0 ) {
                        return 0;
                }
@@ -114,7 +114,7 @@ class Fallback {
         * @param string $enc optional encoding; ignored
         * @return int
         */
-       public static function fallback_mb_strlen( $str, $enc = '' ) {
+       public static function mb_strlen( $str, $enc = '' ) {
                $counts = count_chars( $str );
                $total = 0;
        
@@ -139,7 +139,7 @@ class Fallback {
         * @param $encoding String: optional encoding; ignored
         * @return int
         */
-       public static function fallback_mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
+       public static function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
                $needle = preg_quote( $needle, '/' );
        
                $ar = array();
@@ -160,7 +160,7 @@ class Fallback {
         * @param $encoding String: optional encoding; ignored
         * @return int
         */
-       public static function fallback_mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
+       public static function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
                $needle = preg_quote( $needle, '/' );
        
                $ar = array();
index 6ca9e39..2eaf4a0 100644 (file)
@@ -23,37 +23,37 @@ require_once dirname( __FILE__ ) . '/normal/UtfNormalUtil.php';
 
 if( !function_exists( 'iconv' ) ) {
        function iconv( $from, $to, $string ) {
-               return Fallback::fallback_iconv( $from, $to, $string );
+               return Fallback::iconv( $from, $to, $string );
        }
 }
 
 if ( !function_exists( 'mb_substr' ) ) {
        function mb_substr( $str, $start, $count='end' ) {
-               return Fallback::fallback_mb_substr( $str, $start, $count );
+               return Fallback::mb_substr( $str, $start, $count );
        }
 
        function mb_substr_split_unicode( $str, $splitPos ) {
-               return Fallback::fallback_mb_substr_split_unicode( $str, $splitPos );
+               return Fallback::mb_substr_split_unicode( $str, $splitPos );
        }
 }
 
 if ( !function_exists( 'mb_strlen' ) ) {
        function mb_strlen( $str, $enc = '' ) {
-               return Fallback::fallback_mb_strlen( $str, $enc );
+               return Fallback::mb_strlen( $str, $enc );
        }
 }
 
 if( !function_exists( 'mb_strpos' ) ) {
        
        function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
-               return Fallback::fallback_mb_strpos( $haystack, $needle, $offset, $encoding );
+               return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding );
        }
        
 }
 
 if( !function_exists( 'mb_strrpos' ) ) {
        function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
-               return Fallback::fallback_mb_strrpos( $haystack, $needle, $offset, $encoding );
+               return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding );
        }
 }
 
index ecaa8d3..4f0e0ec 100644 (file)
@@ -422,7 +422,7 @@ class GlobalTest extends MediaWikiTestCase {
                        
                        $this->assertEquals(
                                call_user_func_array( 'mb_substr', $param_set ),
-                               call_user_func_array( array( 'Fallback', 'fallback_mb_substr' ), $param_set ),
+                               call_user_func_array( array( 'Fallback', 'mb_substr' ), $param_set ),
                                'Fallback mb_substr with params ' . implode( ', ', $old_param_set )
                        );                      
                }
@@ -431,7 +431,7 @@ class GlobalTest extends MediaWikiTestCase {
                //mb_strlen
                $this->assertEquals(
                        mb_strlen( $sampleUTF ),
-                       Fallback::fallback_mb_strlen( $sampleUTF ),
+                       Fallback::mb_strlen( $sampleUTF ),
                        'Fallback mb_strlen'
                );                      
                
@@ -452,13 +452,13 @@ class GlobalTest extends MediaWikiTestCase {
                        
                        $this->assertEquals(
                                call_user_func_array( 'mb_strpos', $param_set ),
-                               call_user_func_array( array( 'Fallback', 'fallback_mb_strpos' ), $param_set ),
+                               call_user_func_array( array( 'Fallback', 'mb_strpos' ), $param_set ),
                                'Fallback mb_strpos with params ' . implode( ', ', $old_param_set )
                        );              
                        
                        $this->assertEquals(
                                call_user_func_array( 'mb_strrpos', $param_set ),
-                               call_user_func_array( array( 'Fallback', 'fallback_mb_strrpos' ), $param_set ),
+                               call_user_func_array( array( 'Fallback', 'mb_strrpos' ), $param_set ),
                                'Fallback mb_strrpos with params ' . implode( ', ', $old_param_set )
                        );      
                }