Commit graph

189 commits

Author SHA1 Message Date
Timo Tijhof
9c7dc9e760 installer: Add intro to Welcome page, add Help/Bug/Contribute links
This removes the readme page embedding in the installer.

Bug: T256062
Change-Id: I453a8e691371266634638e81e54ce18e19cb4467
2020-06-22 21:58:43 +01:00
Timo Tijhof
f575721a06 Update all use of $wgVersion to MW_VERSION
Follows-up I04628de4152dd5.

Bug: T212738
Change-Id: I718474ec0d9fd29ac2c05477f0f2493615d8aff5
2020-02-25 02:16:12 +00:00
jenkins-bot
0ca286a1cc Merge "installer: Parse error message" 2020-02-18 20:52:10 +00:00
Tobi_406
6d88beee07
installer: Parse error message
Use $msg->useDatabase( false )->parse() instead of $msg->useDatabase(
false )->plain() to parse wikitext.

Bug: T238464
Change-Id: Ie75a53afd801c506935719e6290999ec040723c5
2020-02-18 21:02:01 +01:00
Petr Pchelko
204fa7e509 Remove usages of deprecated Language methods
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
2020-02-16 00:45:48 +00:00
Timo Tijhof
b118bddc15 installer: Rename Doxygen group from "Deployment" to "Installer"
Also improve the description a bit and explain at a high level
how this code is used, and which classes back those entry points.

Change-Id: Ia69531858e714d0b43a29a7d5b6dcc5c7edd8240
2019-11-25 23:26:20 +00:00
Umherirrender
337ecb0514 Add missing @param and @return to documentation
Change-Id: Ibc5849cc8ea7e7c4eb30ded9c1cfa5f52187c377
2019-11-10 22:12:58 +00:00
Aryeh Gregor
0de9c47b50 Remove Language::factory and getParentLanguage use
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
2019-10-27 12:34:28 +02:00
Volker E
d6ed082b6d installer: Deprecate WebInstaller::getInfoBox, getWarningBox and getErrorBox
Since MW 1.31 there are messageBox, warningBox, errorBox and successBox
available which should be used instead.

These are simple wrappers around Html::messageBox and related methods
which should be used directly instead. Internal usage has been migrated
as of a9252abb1c, but these public methods remain for now. Once
removed we can also removed the internal Html::infoBox() method.

Bug: T232903
Change-Id: I2756c88987754c4e3f84d98c531d8396098cd7fe
2019-09-26 19:26:33 +00:00
Volker E
a9252abb1c Replace infobox usages and extend successbox, warningbox and errorbox
Adding optional $className parameter to provide additional
styling options.
Optional parameter $heading was introduced for MobileFrontend. Therefore
leaving inconsistent parameter order is necessary for the time being.

Bug: T232903
Change-Id: I5857b2c58a47a83156c32f086a73fe2bd48ab0c8
2019-09-24 16:29:32 -07:00
Daimona Eaytoy
c659bc6308 Unsuppress another phan issue (part 7)
Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
2019-09-03 17:19:21 +00:00
Timo Tijhof
1b60564ce7 installer: Remove <doclink/> parser function and last use of it
Pass the url to the Copying page as a message parameter instead.
This results in identical text and styling. Not even "external link"
vs plain link styling difference, because that doesn't exist in the
installer stylesheet.

The message is renamed in this commit because it is a breaking
change (due to <doclink> being removed, and due to $2 being
required).

Bug: T227297
Change-Id: I73efd9ecb193523a7e384a7a40c768d32b2361b8
2019-07-18 01:29:12 +01:00
Timo Tijhof
43ec5d6a9d installer: Avoid <doclink/> hack for 'config-sidebar' rendering
Use separate messages for the link labels instead.

Bug: T227297
Change-Id: I2fda6ef98117781231a0d42c039d333ef829ea98
2019-07-05 18:26:53 +00:00
Timo Tijhof
95c468f778 installer: Convert <downloadlink/> hack to raw message param
Bug: T227297
Change-Id: I9a50342aa0c9525893085e1b8d428556f0262f5c
2019-07-05 18:26:43 +00:00
Timo Tijhof
51e00a4f26 installer: Fix Html::infoBox param docs and mark as internal
This method is very specific to the installer and is only used in one
place, in WebInstaller, and should probably be moved there.

For now, make its documentation less confusing, more correct, and
mark it as `@internal`, this is not a supported public interface.

Bug: T227297
Change-Id: I8902fe34b80c5152bfd37e9c24427ad48b5f4167
2019-07-05 18:26:18 +00:00
Fomafix
1dc40b1cb3 Installer: Use HTML/CSS instead of JavaScript to toggle the help message
Changes in the behavior:
* The expanding/collapsing now works even with disabled JavaScript.
* There is no FOUC on loading anymore.
* The animation on show/hide is absent.

Change-Id: I1b88d8e2cdbb1c969670a7a8637dba10bf447330
2019-06-15 12:29:07 +02:00
Aryeh Gregor
7b4489e019 Get rid of unnecessary func_get_args() and friends
HHVM does not support variadic arguments with type hints.  This is
mostly not a big problem, because we can just drop the type hint, but
for some reason PHPUnit adds a type hint of "array" when it creates
mocks, so a class with a variadic method can't be mocked (at least in
some cases).  As such, I left alone all the classes that seem like
someone might like to mock them, like Title and User.  If anyone wants
to mock them in the future, they'll have to switch back to
func_get_args().  Some of the changes are definitely safe, like
functions and test classes.

In most cases, func_get_args() (and/or func_get_arg(), func_num_args() )
were only present because the code was written before we required PHP
5.6, and writing them as variadic functions is strictly superior. In
some cases I left them alone, aside from HHVM compatibility:

* Forwarding all arguments to another function. It's useful to keep
  func_get_args() here where we want to keep the list of expected
  arguments and their meanings in the function signature line for
  documentation purposes, but don't want to copy-paste a long line of
  argument names.
* Handling deprecated calling conventions.
* One or two miscellaneous cases where we're basically using the
  arguments individually but want to use them as an array as well for
  some reason.

Change-Id: I066ec95a7beb7c0665146195a08e7cce1222c788
2019-04-12 20:17:01 +00:00
Reedy
c13fee87d4 Collapse some nested if statements
Change-Id: I9a97325d738d09370d29d35d5254bc0dadc57ff4
2019-04-04 19:02:22 +00:00
Derick Alangi
3d662e93a2 installer: Replace the use of global $wgParser with services
global $wgParser was deprecated in 1.32 and services are used
instead to get the parser object via MediaWikiServices. Making
this replacement as we're avoiding globals.

Change-Id: I967a52c481bfcc83552053a03e88acb038810828
2019-03-03 15:05:16 +01:00
C. Scott Ananian
873c89fcc4 Only expand {{...}} in messages once (part 2)
If we're going to call `OutputPage::addWikiTextAs*` or
`OutputPage::parseAs*` to parse the message, we don't need to
pre-expand `{{...}}` markup before passing it to the parser.

Follow up to I2f68f73365df876e6f9d017e4e3ddea39c4a1284.

Bug: T206574
Change-Id: I0ee493207ea80c1caba7e60a31714805dc54c64e
2018-10-26 17:09:42 +00:00
Fomafix
43244db9a2 Use PHP 7 '??' operator instead of if-then-else
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
2018-10-21 21:46:46 +02:00
Aryeh Gregor
90d4f56fe4 Mass conversion of $wgContLang to service
Brought to you by vim macros.

Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
2018-08-11 22:44:29 -06:00
Brian Wolff
89b21847e1 Start working on phan-taint-check warnings. Fix minor escaping issues.
This fixes 26 of the phan-taint-check warnings on MW core. Some
are outright fixed, others are false positives that were suppressed.

This really only covers some of the easy ones. There are still
314 warnings to go.

Change-Id: I30463bc3a09fd4324d190de8533f51784764dd3a
2018-07-12 03:26:59 +00:00
jenkins-bot
285134ac56 Merge "Web installer: Correctly escape U+00A0 NO-BREAK SPACE" 2018-07-09 04:26:42 +00:00
Kevin Israel
7a4df753fd Web installer: Correctly escape U+00A0 NO-BREAK SPACE
Unicode escape sequences cannot be used in single quoted strings,
in which they are treated as literal text.

Follows-up 125cbd8c01.

Change-Id: Ife53a613a801b8bb96542b42fd3d2bb3dccaf629
2018-07-08 23:16:22 -04:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Fomafix
125cbd8c01 Use \u{00A0} instead of &#160; or &nbsp;
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities &#160; or &#xa0; or &nbsp;.

With the UTF-8 character the generated HTML is shorter and better to read.

Also change the special value for the label in HTMLForm from &#160; to
U+00A0 but also support &#160; for backward compability.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
2018-06-24 01:20:13 +00:00
Niklas Laxström
4cc7dea1d5 Only use languages with localisation in the installer
To match recent change to Special:Preferences, only allow languages
with localisation as interface or content language.

Bug: T188030
Change-Id: I8acae47ee70feb98bcde982d9b0e3637daf96ffb
2018-06-20 16:21:08 +02:00
jenkins-bot
d62d7eff49 Merge "WebInstaller::docLink: Use Html::element to generate the link" 2018-06-10 08:17:23 +00:00
jenkins-bot
f5db267236 Merge "WebInstaller::getDocUrl: Use getUrl to generate the URL" 2018-06-10 08:16:52 +00:00
Max Semenik
6e956d55aa Replace call_user_func_array(), part 2
Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
2018-06-07 20:19:26 -07:00
Fomafix
83afef0e47 WebInstaller::docLink: Use Html::element to generate the link
Change-Id: I1e3163d9814345e6b108072886b9756cc84d168a
2018-06-07 11:34:37 +02:00
Fomafix
374c81791a WebInstaller::getDocUrl: Use getUrl to generate the URL
This changes ensures to generate the same URLs on doclinks like in the
navigation bar.

mw-config/?page=Welcome has as "Restart installation" the URL
  /.../mw-config/?page=Restart&lastPage=Language
and as "a copy of the GNU General Public License" the URL
before this change
  /.../mw-config/index.php?page=Copying&lastPage=Welcome
after this change
  /.../mw-config/?page=Copying&lastPage=Welcome

Change-Id: Ide5cb52d71363c3a54e1b6ac48c272e1de823322
2018-06-07 11:19:02 +02:00
Kunal Mehta
c8833d8e8e Handle extension dependencies in the installer
As there will likely be extensions bundled with the 1.31 release that
depend upon other extensions, we should have the installer prevent users
from enabling extensions that depend on other, not-enabled extensions.

We can build a dependency map from extension.json's "requires"
component. On the client-side, we'll first disable all checkboxes that
require other extensions, and evaluate each checkbox click, updating the
disabled checkboxes as possible.

This required some refactoring of how ExtensionRegistry reports issues
with dependency resolution so we could get a list of what was missing.

While we're at it, sort the extensions under headings by type.

This does not support skins that have dependencies yet (T186092).

Bug: T31134
Bug: T55985
Change-Id: I5f0e3b1b540b5ef6f9b8e3fc2bbaad1c65b4b680
2018-04-13 15:28:40 -07:00
Gergő Tisza
3b076177b4
Set WebInstaller session variables as globals
During the install process LocalSettings.php does not exist
yet so globals simply take their values from DefaultSettings.php.
The installer uses the correct settings directly for e.g. database
operations, but this blows up when something tries to use
MediaWikiServices which is hardcoded to work with globals.

Make the installer update the globals to work around this.

Bug: T187586
Change-Id: I042099c399bc58929e83178f61e6e6ca478a3ee6
2018-03-19 18:39:00 -07:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
Fomafix
f253c0f07b WebInstaller: Use <div> instead of <span>
The parser output is enclosed by a <div> and must not enclosed into a
<span> because of an HTML validation error.

Bug: T171423
Change-Id: I034d54436a622803fe07d3c93483b9fe705bc925
2017-07-24 07:31:31 +02:00
Thiemo Mättig
d14faa6bed Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

Change-Id: I994d11e05f202b880390723e148d79c72cca29f0
2017-07-10 10:15:51 +00:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Kunal Mehta
4dba618ae0 installer: Allow specifying where LocalSettings.php should be saved
This allows software packages to specify where the LocalSettings.php
file should be saved to when the user is downloading it from the web
installer.

Bug: T123151
Change-Id: I06ded602be9aac0a10773e9d85c4d1585a70933b
2016-06-21 07:53:15 -07:00
Reedy
b5656b6953 Many more function case mismatches
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
2016-03-19 00:20:58 +00:00
Timo Tijhof
f58eea9bbd installer: Update main RequestContext when updating $wgLang
Change-Id: I1e3b76b2358a90a551616dc84eb6f2be6bb41c0a
2016-03-03 01:40:01 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
This, that and the other
da9696333a Installer: Validate password against sysop/bureaucrat policies
Previously, user-group-specific policies were not checked, because the
user hadn't been created yet, and so wasn't assigned to any groups. In his
overhaul of password policy, Chris wrote a function that was designed for
exactly this purpose (UserPasswordPolicy::checkUserPasswordForGroups) but
didn't put it into use.

Some changes to the error handling code are needed so the error messages
display correctly.

Bug: T115700
Change-Id: I1391c77c9667b646b29003bb0b2abcdc21d8c4d8
2015-10-29 23:24:40 +11:00
saper
a93aa28711 Web installer should not pollute global namespace with session variables
There is no need to store session variables
(that also include user-supplied arguments)
as $wgXXX global variables.

Bug: T116375
Change-Id: I880d4299566beaf99ed1fc21c690cdda64149b0e
2015-10-24 02:00:02 +02:00
Brad Jorsch
673c07656e Fix "installer started" detection
NoLocalSettings.php tries to detect whether the installer has been
started or not. But this detection has been broken since I4cf237d when a
change was made to stop setting the session name when NO_SESSION is
defined, causing NoLocalSettings.php to be looking at a different
session-cookie than is actually being used by the installer.

The complete fix is twofold:
* Have WebInstaller::startSession() call session_name()
* Have NoLocalSettings.php not call session_name() when PHP's
  session.auto_start configuration setting is set.

Change-Id: I618d11df902b5d1f70e175bc94137621e9195c2f
2015-10-09 17:34:48 -04:00
Siebrand Mazeland
2bdfbe629f Fix PHPCS warnings in includes/installer
8 uses of $IP remain, which trigger the global naming convention
check.

Change-Id: I1040782323ec7512fb7badd6052742ecd13d9dff
2015-09-28 13:40:27 +02:00
Ori Livneh
1e06a9f02f mediawiki.legacy.config: use own help-field styling
Instead of using .mw-help-field-container from mediawiki.legacy to style help
tooltips, use a class that is specific to the WebInstaller and which is styled
in its stylesheet. This allows us to stop embedding it in mediawiki.legacy
(which is loaded on every page).

The CSS is copied directly from the styles for mw-help-field-container et al.
in mediawiki.legacy.

Change-Id: I8e092e9d2c91b5f70499d93c1134f43f2e96348c
2015-08-14 21:28:37 -07:00
Chad Horohoe
785a8289d3 Do not support new installations via .php5 entrypoint any longer
Continues the path of deprecating $wgScriptExtension and all of
the related baggage.

You'll only end up with sadness when we rip out of the rest of
this later so don't let people shoot themselves in the foot.

Change-Id: I34cd1d2c266405ebc761a271e3740e972fb7cf2f
2015-06-02 08:38:57 -07:00
Chad Horohoe
3809b6a39b Installer: fix images in CSS
Paths are tricky and installer code is old and ugly. Somebody
should really clean this up. Prep the paths always, not just
on the environment checks page.

Co-Authored-By: Timo Tijhof <krinklemail@gmail.com>
Bug: T100145
Change-Id: I4e55c59c2bed0dc94e6bc3a8c59709ec80822235
2015-05-24 13:28:54 +00:00