* (bug 3224) Allow minor edits by bots to skip new message notification on
[lhc/web/wiklou.git] / install-utils.inc
index 33109a6..2bc67c2 100644 (file)
@@ -7,22 +7,14 @@ function install_version_checks() {
 
        if( !function_exists( 'version_compare' ) ) {
                # version_compare was introduced in 4.1.0
-               echo "Your PHP version is much too old; 4.0.x will _not_ work. 4.3.2 or higher is required. ABORTING.\n";
+               echo "Your PHP version is much too old; 4.0.x will _not_ work. 5.0.0 or higher is required. ABORTING.\n";
                die( -1 );
        }
-       if( version_compare( phpversion(), '4.3.2' ) < 0 ) {
-               echo "PHP 4.3.2 or higher is required. ABORTING.\n";
+       if( version_compare( phpversion(), '5.0.0' ) < 0 ) {
+               echo "PHP 5.0.0 or higher is required. ABORTING.\n";
                die( -1 );
        }
 
-       if (!extension_loaded('mysql')) {
-               if (!dl('mysql.so')) {
-                       print 'Could not load MySQL driver! Please compile '.
-                                 "php --with-mysql or install the mysql.so module.\n";
-               exit;
-               }
-       }
-
        global $wgCommandLineMode;
        $wgCommandLineMode = true;
        umask( 000 );
@@ -59,12 +51,9 @@ function copydirectory( $source, $dest ) {
 }
 
 function readconsole( $prompt = '' ) {
-       static $isatty = null, $fp = null;
-       if ( is_null( $fp ) ) {
-               $fp = fopen( 'php://stdin', 'r' );
-       }
+       static $isatty = null;
        if ( is_null( $isatty ) ) {
-               if ( !function_exists( 'posix_isatty' ) || posix_isatty( $fp ) ) {
+               if ( !function_exists( 'posix_isatty' ) || posix_isatty( STDIN ) ) {
                        $isatty = true;
                } else {
                        $isatty = false;
@@ -77,10 +66,10 @@ function readconsole( $prompt = '' ) {
                if ( $isatty ) {
                        print $prompt;
                }
-               if ( feof( $fp ) ) {
+               if ( feof( STDIN ) ) {
                        return false;
                }
-               $st = fgets($fp, 1024);
+               $st = fgets(STDIN, 1024);
                if ($st === false) return false;
                $resp = trim( $st );
                return $resp;