From: X! Date: Tue, 4 Jan 2011 01:44:11 +0000 (+0000) Subject: Fix r79494: Don't prefix functions now that they're in their own class X-Git-Tag: 1.31.0-rc.0~32844 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=e1f21873d5f5b72412083d04f4bca61512811553;p=lhc%2Fweb%2Fwiklou.git Fix r79494: Don't prefix functions now that they're in their own class --- diff --git a/includes/Fallback.php b/includes/Fallback.php index 422ea8a27e..06dc9e79b0 100644 --- a/includes/Fallback.php +++ b/includes/Fallback.php @@ -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(); diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6ca9e39586..2eaf4a0ba7 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 ); } } diff --git a/tests/phpunit/includes/GlobalTest.php b/tests/phpunit/includes/GlobalTest.php index ecaa8d3e8a..4f0e0ec023 100644 --- a/tests/phpunit/includes/GlobalTest.php +++ b/tests/phpunit/includes/GlobalTest.php @@ -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 ) ); }