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 );
}
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;
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;