From ea35e3657deb43335887b269b011b9dc57aa1353 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 4 Jul 2010 19:44:21 +0000 Subject: [PATCH] new-installer: Use `` instead of wfShellExec() like the old installer This avoids runnin into the memory limitation of ulimit.sh when auto-detecting if programs exist during installation. On my 64 bit Debian system calling e.g. diff3 --version takes more than the default 10MB memory limit. Can be reproduced as: &1"); echo "<$var>\n"; ?> Which on my system gives you: php test.php /home/avar/g/phase3/bin/ulimit4.sh: xmalloc: ../bash/variables.c:3446: cannot allocate 1270 bytes (53248 bytes allocated) <> The old installer just did ``, revert to this behavior until we raise the default memory limit, or find some workaround for this issue. --- includes/installer/Installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 6319428fa7..24da5cc138 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -581,7 +581,9 @@ abstract class Installer { return $command; $file = str_replace( '$1', $command, $versionInfo[0] ); - if ( strstr( wfShellExec( $file ), $versionInfo[1]) !== false ) + # Should maybe be wfShellExec( $file), but runs into a ulimit, see + # http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=prev&oldid=335456 + if ( strstr( `$file`, $versionInfo[1]) !== false ) return $command; } } -- 2.20.1