From 8b1c53a769e18e50876da3c90142bfd100a94127 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 31 Jul 2017 15:28:47 -0700 Subject: [PATCH] Warn users when installing on a 32-bit system Don't fail to install, because we don't explicitly need to break 32-bit support. But in this day and age it's becoming increasingly likely to break things on a 32-bit system. So let's at least let a system admin know that YMMV. Change-Id: Ifb3bfa049532d82f67fe4375944af1516400513c --- includes/installer/Installer.php | 15 +++++++++++++++ includes/installer/i18n/en.json | 1 + includes/installer/i18n/qqq.json | 1 + 3 files changed, 17 insertions(+) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 46aa518870..ae80c8bb17 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -134,6 +134,7 @@ abstract class Installer { 'envCheckUploadsDirectory', 'envCheckLibicu', 'envCheckSuhosinMaxValueLength', + 'envCheck64Bit', ]; /** @@ -1081,6 +1082,20 @@ abstract class Installer { return true; } + /** + * Checks if we're running on 64 bit or not. 32 bit is becoming increasingly + * hard to support, so let's at least warn people. + * + * @return bool + */ + protected function envCheck64Bit() { + if ( PHP_INT_SIZE == 4 ) { + $this->showMessage( 'config-using-32bit' ); + } + + return true; + } + /** * Convert a hex string representing a Unicode code point to that code point. * @param string $c diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json index bb245f5471..6319b76da7 100644 --- a/includes/installer/i18n/en.json +++ b/includes/installer/i18n/en.json @@ -75,6 +75,7 @@ "config-no-cli-uploads-check": "Warning: Your default directory for uploads ($1) is not checked for vulnerability\nto arbitrary script execution during the CLI install.", "config-brokenlibxml": "Your system has a combination of PHP and libxml2 versions that is buggy and can cause hidden data corruption in MediaWiki and other web applications.\nUpgrade to libxml2 2.7.3 or later ([https://bugs.php.net/bug.php?id=45996 bug filed with PHP]).\nInstallation aborted.", "config-suhosin-max-value-length": "Suhosin is installed and limits the GET parameter length to $1 bytes.\nMediaWiki's ResourceLoader component will work around this limit, but that will degrade performance.\nIf at all possible, you should set suhosin.get.max_value_length to 1024 or higher in php.ini, and set $wgResourceLoaderMaxQueryLength to the same value in LocalSettings.php.", + "config-using-32bit": "Warning: your system appears to be running with 32-bit integers. This is [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:32-bit not advised].", "config-db-type": "Database type:", "config-db-host": "Database host:", "config-db-host-help": "If your database server is on different server, enter the host name or IP address here.\n\nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation.\n\nIf you are installing on a Windows server and using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address.\n\nIf you are using PostgreSQL, leave this field blank to connect via a Unix socket.", diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json index 3bf7ccb325..30eb5ee253 100644 --- a/includes/installer/i18n/qqq.json +++ b/includes/installer/i18n/qqq.json @@ -95,6 +95,7 @@ "config-no-cli-uploads-check": "CLI = [[w:Command-line interface|command-line interface]] (i.e. the installer runs as a command-line script, not using HTML interface via an internet browser)", "config-brokenlibxml": "Status message in the MediaWiki installer environment checks.", "config-suhosin-max-value-length": "{{doc-important|Do not translate \"length\", \"suhosin.get.max_value_length\", \"php.ini\", \"$wgResourceLoaderMaxQueryLength\" and \"LocalSettings.php\".}}\nMessage shown when PHP parameter suhosin.get.max_value_length is between 0 and 1023 (that max value is hard set in MediaWiki software).", + "config-using-32bit": "Warning message shown when installing on a 32-bit system.", "config-db-type": "Field label in the MediaWiki installer followed by possible database types.", "config-db-host": "Used as label.\n\nAlso used in {{msg-mw|Config-missing-db-host}}.", "config-db-host-help": "{{doc-singularthey}}", -- 2.20.1