r76221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76220‎ | r76221 | r76222 >
Date:22:34, 6 November 2010
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Fix two errors from r76220:
* Fatal error: Call to undefined function readlineEmulation() in maintenance/Maintenance.php on line 1075
* sh: Array: command not found
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Maintenance.php
@@ -1072,7 +1072,7 @@
10731073 return readline( $prompt );
10741074 } else {
10751075 if ( $isatty ) {
1076 - $st = readlineEmulation( $prompt );
 1076+ $st = self::readlineEmulation( $prompt );
10771077 } else {
10781078 if ( feof( STDIN ) ) {
10791079 $st = false;
@@ -1092,7 +1092,7 @@
10931093 * @return String
10941094 */
10951095 private static function readlineEmulation( $prompt ) {
1096 - $bash = array( 'bash' );
 1096+ $bash = 'bash';
10971097 if ( !wfIsWindows() && Installer::locateExecutableInDefaultPaths( $bash ) ) {
10981098 $retval = false;
10991099 $encPrompt = wfEscapeShellArg( $prompt );

Follow-up revisions

RevisionCommit summaryAuthorDate
r76223Fix for r76221: Installer::locateExecutableInDefaultPaths() takes an array as...ialex22:46, 6 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76220Trying to kill install-utils.inc/old install crap:...demon22:16, 6 November 2010

Comments

#Comment by 😂 (talk | contribs)   22:39, 6 November 2010

Stupid mistake on the first one, thanks for catching.

Second one I'm confused. locateExecutableInDefaultPaths() is designed to take an array as well.

#Comment by IAlex (talk | contribs)   22:49, 6 November 2010

Problem was line 1101 were the $bash array was converted to string:

$line = wfShellExec( "$bash -c $encCommand", $retval );

Status & tagging log