星耀晨曦 has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/403657 )
Change subject: Add an item that checks if curl extension exists
......................................................................
Add an item that checks if curl extension exists
As it turns out, InstantCommons feature relies on curl extension. We can
check the environment at the same time check PHP is loaded with curl
extension. If it is not loaded, installer prompts missing curl
extension but does not block the installation.
Bug: T184652
Change-Id: I2e4a4f12334f2956fd0910169a84e6abcaf0564b
---
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
3 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/57/403657/1
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 5ea9bfe..1b9b2f2 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -135,6 +135,7 @@
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
'envCheck64Bit',
+ 'envCheckCurl'
];
/**
@@ -1108,6 +1109,20 @@
}
/**
+ * Checks if PHP has loaded curl extension.
+ * InstantCommons feature relies on curl extension.
+ *
+ * @return bool
+ */
+ protected function envCheckCurl() {
+ if ( !extension_loaded( 'curl' ) ) {
+ $this->showMessage( 'config-without-curl' );
+ }
+
+ return true;
+ }
+
+ /**
* Convert a hex string representing a Unicode code point to that code
point.
* @param string $c
* @return string|false
diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 6d4c485..03751af 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -313,6 +313,7 @@
"config-skins-screenshots": "$1 (screenshots: $2)",
"config-skins-screenshot": "$1 ($2)",
"config-screenshot": "screenshot",
+ "config-without-curl": "Could not find
[http://php.net/manual/book.curl.php curl extension],
[https://www.mediawiki.org/wiki/InstantCommons InstantCommons] feature can not
work.",
"mainpagetext": "<strong>MediaWiki has been installed.</strong>",
"mainpagedocfooter": "Consult the
[https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide]
for information on using the wiki software.\n\n== Getting started ==\n*
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings
Configuration settings list]\n*
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]\n*
[https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki
release mailing list]\n*
[https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources
Localise MediaWiki for your language]\n*
[https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn
how to combat spam on your wiki]"
}
diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json
index 2fc95ce..138a4b7 100644
--- a/includes/installer/i18n/qqq.json
+++ b/includes/installer/i18n/qqq.json
@@ -333,6 +333,7 @@
"config-skins-screenshots": "Radio button text, $1 is the skin name,
and $2 is a list of links to screenshots of that skin",
"config-skins-screenshot": "Radio button text, $1 is the skin name, and
$2 is a link to a screenshot of that skin, where the link text is
{{msg-mw|config-screenshot}}.",
"config-screenshot": "Link text for the link in
{{msg-mw|config-skins-screenshot}}\n{{Identical|Screenshot}}",
+ "config-without-curl": "Could not find PHP curl extension.",
"mainpagetext": "Along with {{msg-mw|mainpagedocfooter}}, the text you
will see on the Main Page when your wiki is installed.",
"mainpagedocfooter": "Along with {{msg-mw|mainpagetext}}, the text you
will see on the Main Page when your wiki is installed.\nThis might be a good
place to put information about <nowiki>{{GRAMMAR:}}</nowiki>. See
[[{{NAMESPACE}}:{{BASEPAGENAME}}/fi]] for an example. For languages having
grammatical distinctions and not having an appropriate
<nowiki>{{GRAMMAR:}}</nowiki> software available, a suggestion to check and
possibly amend the messages having <nowiki>{{SITENAME}}</nowiki> may be
valuable. See [[{{NAMESPACE}}:{{BASEPAGENAME}}/ksh]] for an example."
}
--
To view, visit https://gerrit.wikimedia.org/r/403657
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e4a4f12334f2956fd0910169a84e6abcaf0564b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: 星耀晨曦 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits