+function readconsole( $prompt = '' ) {
+ static $isatty = null, $fp = null;
+ if ( is_null( $fp ) ) {
+ $fp = fopen( 'php://stdin', 'r' );
+ }
+ if ( is_null( $isatty ) ) {
+ if ( !function_exists( 'posix_isatty' ) || posix_isatty( $fp ) ) {
+ $isatty = true;
+ } else {
+ $isatty = false;
+ }
+ }
+
+ if ( $isatty && function_exists( 'readline' ) ) {