Add compatibility file_get_contents; fix compat iconv
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 14:47:31 +0000 (14:47 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 14:47:31 +0000 (14:47 +0000)
includes/GlobalFunctions.php

index 9efda15..22ae3ca 100644 (file)
@@ -29,13 +29,20 @@ if( !function_exists('iconv') ) {
        # Assume will only ever use utf-8 and iso-8859-1.
        # This will *not* work in all circumstances.
        function iconv( $from, $to, $string ) {
-               if(strcasecmp( $from, to ) == 0) return $string;
+               if(strcasecmp( $from, $to ) == 0) return $string;
                if(strcasecmp( $from, "utf-8" ) == 0) return utf8_decode( $string );
                if(strcasecmp( $to, "utf-8" ) == 0) return utf8_encode( $string );
                return $string;
        }
 }
 
+if( !function_exists('file_get_contents') ) {
+       # Exists in PHP 4.3.0+
+       function file_get_contents( $filename ) {
+               return implode( "", file( $filename ) );
+       }
+}
+
 $wgRandomSeeded = false;
 
 function wfSeedRandom()