Commit graph

122 commits

Author SHA1 Message Date
jenkins-bot
e303257d2e Merge "Change " to ' for values that may need to escape $" 2024-02-07 02:40:10 +00:00
cicalese
fa3caaf764 Change " to ' for values that may need to escape $
Bug: T355013
Change-Id: I80d013cd7d3192912202000a3eedb79f965a3850
2024-01-13 20:50:41 -05:00
Reedy
8600ee105c installer: Namespace more installer classes
Change-Id: If58d96c311bef728446b517bb7a81316b23aad4d
2024-01-13 23:42:08 +00:00
Kosta Harlan
06176a71b4
mw-install:sqlite: Load DevelopmentSettings
Why:

- We want developers to have DevelopmentSettings loaded by default

What:

- Define a new `--with-developmentsettings` argument for install.php,
  Set it to true in the `composer mw-install:sqlite` invocation

For now, this option is not supported in the web installer.

Bug: T347347
Change-Id: Icba2d614fd1349463fb745ef31f53a3b3834e5ad
2023-11-29 10:00:48 +01:00
Timo Tijhof
8a0e6cfe31 docs: Fix broken references to docs/Configuration.md
Follows-up a5277ce87f (Ie6152cf510). This file no longer exists.
Update references to MainConfigSchema or MainConfigSchema.php instead.

Bug: T300129
Change-Id: I40a8881e843cc75a10e44b51ed0784fdc834f0e5
2022-09-07 16:36:21 +00:00
Timo Tijhof
d291c5b9bc skin,installer: Trim spaced lines from generated settings file
Before:

```
$wgLogos = [
<tab>'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
<tab>
<tab>
<tab>'icon' => "$wgResourceBasePath/resources/assets/change-your-logo-icon.svg",
];
```

After:

```
$wgLogos = [
<tab>'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",
<tab>'icon' => "$wgResourceBasePath/resources/assets/change-your-logo-icon.svg",
];
```

Change-Id: Idc6e4963dbb5b6a1afa43393519e3b28b08b4c23
2022-08-02 19:01:01 +00:00
Máté Szabó
36dd10f9de Migrate use of ${var}-style string interpolation
The "${var}" and "${expr}" style string interpolations are deprecated in
PHP 8.2. Migrate usages in core to "{$var}" as appropriate.

Bug: T314096
Change-Id: I269bad3d4a68c2b251b3e71a066289d4ad9fd496
2022-07-29 02:45:09 +02:00
Fomafix
b7dff252ca Fix documentation of includes/languages/data/Names.php
The file Names.php was moved from
languages/data/Names.php to
includes/languages/data/Names.php
in e07a279a39.

This change updates the references in documentations.

Change-Id: I95ae3368ec6b7e9a3dfa85257e8d163fde7a47db
2022-04-23 20:12:14 +00:00
Jon Robson
9bd3af32fc Update installer to reflect modern logos
There are now 4 types of logos, only one of which is needed.
Update documentation in installer to reflect this.
Also make it possible to drag and drop files into the installer
and see live previews of what the logos will look like to aid
setup.

The 1x is no longer required.

Bug: T255913
Change-Id: I58226ae8fb02c32d2eeea65a50aaabbc193cb51c
2022-03-10 16:48:39 +00:00
daniel
a5277ce87f Avoid references to DefaultSettings.
This replaces references to DefaultSettings with
references to config-schema.yaml where appropriate.

NOTE: this does not yet change Setup.php. DefaultSettings.php
remains intact and is still being used.

NOTE: this does not remove usages in the installer, see I5d8843a1062fbf
for that.

Bug: T300129
Change-Id: Ie6152cf510c3be61bc22167ca6d90dfc28910a45
2022-02-22 19:43:50 +01:00
Tim Starling
65b1b6b56a Remove $wgShellLocale, always use C
$wgShellLocale was a flawed solution to the problem of locale
dependence. MediaWiki has its own concept of locale (the Language
hierarchy) and any kind of dependence on the server's libc locale is
incorrect and harmful, leading to bugs. Developers have an expectation
that functions like strtolower() will work in a certain way, and
respecting the locale set in the environment at install time violates
this expectation.

The problems with using C as a locale, which led to $wgShellLocale, are:

* escapeshellarg() will strip non-ASCII characters. This can be worked
  around by not using it. The security vulnerability it was trying to
  fix can be prevented in another way.
* Shell commands like rsvg will fail to correctly interpret UTF-8
  arguments. This is the reason for the putenv(). On Linux, this can
  be fixed by using C.UTF-8, which we didn't know at the time. On
  Windows, the problem is not relevant (there are unrelated issues
  with UTF-8 arguments).

Bug: T291234
Change-Id: Ib5ac0e7bc720dcc094303a358ee1c7bbdcfc6447
2021-09-24 17:25:01 -07:00
Gergő Tisza
39383ea1af
Installer: Add $wgLocaltimezone to LocalSettings template
If $wgLocaltimezone isn't hard-coded, it is evaluated from the
system timezone. On some systems this isn't guaranteed to be
static, for example on Debian, GMT can get converted to UTC,
instead of Europe/London. This can throw off code that relies
on consistent time zones or signatures. Hard-code the auto-
detected timezone value in LocalSettings.php to avoid this.

Also switch up the order of two variables to keep localization-
related settings next to each other.

Bug: T21991
Bug: T290464
Change-Id: I315a55a3129eeb81711232f59467eb8a2c59a80e
2021-09-12 09:51:02 -07:00
James D. Forrester
641ba981cf LocalSettingsGenerator: Don't use 'ie' when you mean 'e.g.'
Change-Id: I642ea9166c57dba297d9f3d171235d999a69b09a
2021-05-27 14:37:44 -07:00
Tim Starling
5b1c7fc157 Fix English/*nix specific error messages in FSFileBackend
FileBackend::getFileList() is supposed to return an empty array when the
specified path does not exist, however this was broken on Windows due to
a difference in the exception message raised by DirectoryIterator.

Unit tests and code inspection showed that there were several other
instances of unmatched Windows error messages, which I also fixed. Now
FileBackendIntegrationTest passes on Windows.

It was also broken when $wgShellLocale is set to a non-English locale.
Recommend against this in the default LocalSettings.php. Work around
the issue using socket_strerror() if available. I was able to confirm
the bug and the fix using the existing tests.

Bug: T265778
Change-Id: I2b4cfbb1554d9e05cce53513f4b474064fb57de5
2020-12-03 15:00:02 +11:00
kevinbazira
dacb021b08 Move 'actor' SharedTable to LocalSettings
Following the recommendation here T243276#6524236,
we removed the 'actor' table from wgSharedTables in DefaultSettings.php
and added it to wgSharedTables in LocalSettingsGenerator.php

This undoes a change merged in Idea6b450f6,
which has not been part of a public release.

Bug: T243276
Change-Id: I06d1e56d7a9314d42170a0e2e060712965371fc9
2020-10-18 05:54:54 +00:00
Umherirrender
d790580fda Fix typos related to repeated words
Change-Id: Ibc187d95b003017255bc87adf56afae7a59bd3db
2020-09-27 10:25:36 +00:00
James D. Forrester
384d493f61 installer: Write to wgLogos, not wgLogo
During development, the default value accidentally got lost in
several ways. To avoid that from going unnoticed in the future,
an error is introduced if the Logo input field is empty.

Bug: T247790
Bug: T232140
Bug: T50084
Change-Id: I5a198474473ae1d5595a6fcd64a08205d03be5c0
2020-07-29 02:15:51 +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
Kunal Mehta
e248b5d287 installer: Fix typo in extension loading instructions
Change-Id: Id82b952ec01934c09944bbc0a9be798e39a45d30
2020-01-26 19:21:24 -08: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
Daimona Eaytoy
290ab29617 Declare dynamic properties
This is for classes with a single undeclared property - aside from
BlockManager: I3f51fd3579514b83b567dfe20926df2f0930dc85 removed the
declaration of $permissionManager without actually removing all uses.

Change-Id: Ic2a95f77071312041be6e0633ea9b5325e98de42
2019-09-14 15:21:26 +02:00
Shreyas Minocha
d5b2a1621b
Fix small typos
"publically" → "publicly"

Change-Id: I712d97c0504d52c96532b4aac4f332ef39670955
2019-01-27 17:40:18 +05:30
Kunal Mehta
50212e6d0e installer: Add support for PlatformSettings.php
PlatformSettings.php is a standardized and recommended way for
re-distributors and packagers of MediaWiki to be able to tune
DefaultSettings.php as appropriate.

If includes/PlatformSettings.php exists, the installer will
automatically include it as part of the generated LocalSettings.php.

The main advantage of this system is that if the distributor wants to
change the default settings, all users will benefit immediately. And if
people want a vanilla MediaWiki experience, they can just remove the
inclusion from their LocalSettings.php.

This RfC
(<https://www.mediawiki.org/wiki/Requests_for_comment/PlatformSettings.php>)
was approved by TechCom.

Bug: T182020
Change-Id: I34f9a4acbe86b9c5c80ac16451b317ce5f6640f9
2018-04-10 02:51:02 +00:00
Hoto Cocoa
adf170a553 LocalSettingsGenerator: Fix typo in exception message
Change-Id: I61fe67468eec659f312fb9aa4c20ec9bf083e78b
2017-12-07 06:19:04 +00: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
jenkins-bot
212f96ec2a Merge "Properly detect if CACHE_ACCEL is available in the installer" 2017-05-05 20:52:19 +00:00
Brad Jorsch
3b84e7f31c Change default $wgShellLocale to C.UTF-8, and use it to set LC_ALL
It's less likely to cause surprises than language-specific defaults.

Bug: T107128
Change-Id: Ife7673255798f3a3d72028a26607c56b9b7fb224
2017-05-04 05:53:47 +00:00
Brian Wolff
35c725e157 Properly detect if CACHE_ACCEL is available in the installer
The variable was getting mangled.

Follow up 1fec847c6b

Bug: T160519
Change-Id: I7f7e1530725737020c98747730f2bd363616258c
2017-04-08 04:13:21 +00:00
Aleksey Bekh-Ivanov (WMDE)
350b138a7d Revert "Default to CACHE_ACCEL if user skips advanced settings"
This reverts commit 1fec847c6b.

Bug: T160519
Change-Id: I3bbfb5c5b61b8587ddc4af4fa134de6c86f46d98
2017-03-16 06:51:13 +00:00
Brian Wolff
1fec847c6b Default to CACHE_ACCEL if user skips advanced settings
In the event user skips advanced settings in the installer, and
CACHE_ACCEL is available, we should default to it. This is already
the default in the event the user goes to advanced settings
since b3dc2fedc5

Bug: T160495
Change-Id: Icaa2ca4e8eb63254142e837d2a47b6023a8ea0a2
2017-03-15 06:39:45 +00:00
Erik Bernhardson
d67197fa11 Cleanup some incorrect return annotations
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
2016-12-12 10:15:05 -08:00
Amir Sarabadani
6b221fa96a Clean up array() syntax in docs, part IV
Change-Id: If626409a93d31bf90c054c9bf7ba44a78ea9a621
2016-08-26 16:06:58 +04:30
Ori Livneh
f181cdec56 Add option for sharing info about this MediaWiki install via pingback
When $wgPingback is true, MediaWiki will periodically ping
https://www.mediawiki.org/beacon with basic information about the local
MediaWiki installation.  This data includes, for example, the type of system,
PHP version, and chosen database backend.

The pingback is sent via a deferred (post-send) update whenever $wgVersion
changes, using the updatelog table to ensure we don't send duplicate pingbacks.
A database lock ensures only one thread attempts to send the pingback, and a
cache key throttles attempts to no more than once per hour.

$wgPingback is false by default. The web installer has a checkbox for
controlling this option, and it is checked by default. This nudges new installs
to turn on pingbacks, but does not sneak this decision past sysops of existing
installs.

Change-Id: Ie43a6b46a07ebd9ccc1b9c3001f2ea02435d826b
2016-07-21 21:00:28 +00:00
umherirrender
f800abc858 Use short array for generator output
The AutoloadGenerator and LocalSettingsGenerator should generate short
array syntax

Change-Id: I5772640556fd6274db0d522341a98c0acfe5794d
2016-02-17 22:08:07 +01: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
Kevin Israel
94e5b80fee Remove references to safe_mode INI setting
The feature no longer exists starting in PHP 5.4.0, and MediaWiki
now only supports PHP 5.5.9 or newer.

Change-Id: I3f2d1b564c50f0a28ec1ec0abd7d1b242e26953b
2016-02-12 19:18:26 -05:00
Brad Jorsch
854406883e Add release notes and installer support for $wgAuthenticationTokenVersion
Change-Id: I092a0052b2ab50310cd8ca403d6b2f201b482d5b
2016-02-08 18:20:33 -07:00
Tim Starling
f43e0d840f Use autoloader for PHP data files instead of include/require
Move ZhConversion.php and Names.php to languages/data and make them both
expose their data as static class variables instead of in the local
scope. This means that the autoloader can be used to load the data,
which is efficient and secure. This also makes additional request-local
caching of the arrays unnecessary.

Change-Id: Iafb96ac4165d0965fcb9a69f1d0a91139ea9790c
2016-01-30 13:08:46 +11:00
jenkins-bot
f4a5507a96 Merge "Installer: use _MainCacheType form variable" 2015-10-26 17:32:52 +00:00
saper
1730a17929 Installer: use _MainCacheType form variable
Do not use "wgMainCacheType" form variable
name that contains values that cannot be
assigned to $wgMainCacheType

Bug: T116375
Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46
2015-10-26 17:10:13 +00:00
jenkins-bot
7bd0201183 Merge "installer: Remove additional newline in LocalSettings.php" 2015-10-25 20:33:04 +00:00
saper
53912df2ea installer: Remove additional newline in LocalSettings.php
Change-Id: I6a0630d109c0ab4299507d125e4e1748055bcd58
2015-10-25 20:21:46 +00:00
saper
9b6257a8c4 installer: Define $wgResourceBasePath in LocalSettings.php
Bug: T116374
Bug: T75031
Change-Id: I459c1097ed7048c3fe24e636e9ea22ec2e3b2675
2015-10-23 23:41:06 +02:00
jenkins-bot
1271bb75c6 Merge "Update comment about enabled extensions" 2015-10-13 11:39:18 +00:00
haritha28
0299ac0210 Update comment about enabled extensions
The comment message given in enabling the extensions
are based on for the earlier versions of mediawiki which
uses the requireonce() and as at present all the versions
since 1.25 uses wfLoadExtensions() the comment message
have been changed accordingly.

Bug: T100940
Change-Id: I915a4893cc2d89624c9d8dd6504d7dc8bf166cd9
2015-10-13 11:29:20 +00:00
Timo Tijhof
31b41c535b Use wgResourceBasePath instead of wgScriptPath for wgStylePath etc.
This make re-configuring these much easier by only needing to update
one variable instead of four.

Also remove redundant hardcoding of wgStylePath and wgResourceBasePath
in the generated LocalSettings.php file during installation. This way
changing wgScriptPath will naturally result in the other variables
updating too. We already do this for many other variables (such as
wgLoadScript, wgScript, wgExtensionAssetsPath, etc.).

Change-Id: Ide74355b4054c78214c17f3b2d6fa2f5270e0ab9
2015-09-01 18:18:03 +02:00
Alex Monk
e7c9096ecc HTTPS-ify links to Wikimedia's sites in MW core source
See https://blog.wikimedia.org/2015/06/12/securing-wikimedia-sites-with-https/

Ignoring SVN stuff because svn.wikimedia.org's SSL certificate has expired, and
ignoring wgSharedUploadPath because T25122 wants to get rid of it.

Also a couple of BZ -> phab changes

Change-Id: I02fd23ac6c30a4a4c718e57d4dedbc693dd653c0
2015-06-13 19:23:23 +01: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
Timo Tijhof
f325d07b6c installer: Export wgResourceBasePath in LocalSettingsGenerator
wgRightsIcon uses wgResourceBasePath in its value, therefore it
must be exported first. Otherwise $wgResourceBasePath will still
be null (as from DefaultSettings.php) and cause an incorrect
value to be assigned.

Also fix $wgLogo to use wgResourceBasePath instead of wgScriptPath,
to match what Setup.php does already.

Bug: T75031
Change-Id: I6f18895f3caa50871327eec108fc7d70c1077f1e
2015-05-24 11:30:21 +02:00
Kunal Mehta
7935bd4c80 installer: Use wfLoadExtension/Skin in LocalSettingsGenerator
Bug: T87791
Change-Id: I37cede7396d9677466ec68289702a3a73f1a1f8a
2015-04-01 00:16:17 -07:00