Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -692,14 +692,8 @@ |
693 | 693 | * TODO: document |
694 | 694 | */ |
695 | 695 | public function envCheckShellLocale() { |
696 | | - # Give up now if we're in safe mode or open_basedir. |
697 | | - # It's theoretically possible but tricky to work with. |
698 | | - if ( wfIniGetBool( "safe_mode" ) || ini_get( 'open_basedir' ) || !function_exists( 'exec' ) ) { |
699 | | - return true; |
700 | | - } |
701 | | - |
702 | 696 | $os = php_uname( 's' ); |
703 | | - $supported = array( 'Linux', 'SunOS', 'HP-UX' ); # Tested these |
| 697 | + $supported = array( 'Linux', 'SunOS', 'HP-UX', 'Darwin' ); # Tested these |
704 | 698 | |
705 | 699 | if ( !in_array( $os, $supported ) ) { |
706 | 700 | return true; |
— | — | @@ -707,13 +701,13 @@ |
708 | 702 | |
709 | 703 | # Get a list of available locales. |
710 | 704 | $lines = $ret = false; |
711 | | - exec( '/usr/bin/locale -a', $lines, $ret ); |
| 705 | + $lines = wfShellExec( '/usr/bin/locale -a', $ret, true ); |
712 | 706 | |
713 | 707 | if ( $ret ) { |
714 | 708 | return true; |
715 | 709 | } |
716 | 710 | |
717 | | - $lines = wfArrayMap( 'trim', $lines ); |
| 711 | + $lines = wfArrayMap( 'trim', explode( "\n", $lines ) ); |
718 | 712 | $candidatesByLocale = array(); |
719 | 713 | $candidatesByLang = array(); |
720 | 714 | |
— | — | @@ -905,10 +899,7 @@ |
906 | 900 | } |
907 | 901 | |
908 | 902 | $file = str_replace( '$1', $command, $versionInfo[0] ); |
909 | | - |
910 | | - # Should maybe be wfShellExec( $file), but runs into a ulimit, see |
911 | | - # http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=prev&oldid=335456 |
912 | | - if ( strstr( `$file`, $versionInfo[1]) !== false ) { |
| 903 | + if ( strstr( wfShellExec( $file ), $versionInfo[1]) !== false ) { |
913 | 904 | return $command; |
914 | 905 | } |
915 | 906 | } |
Index: trunk/phase3/includes/installer/CoreInstaller.php |
— | — | @@ -448,6 +448,9 @@ |
449 | 449 | |
450 | 450 | // Allow multiple ob_flush() calls |
451 | 451 | $GLOBALS['wgDisableOutputCompression'] = true; |
| 452 | + |
| 453 | + // Some of the environment checks make shell requests, remove limits |
| 454 | + $GLOBALS['wgMaxShellMemory'] = 0; |
452 | 455 | } |
453 | 456 | |
454 | 457 | /** |