Commit graph

82 commits

Author SHA1 Message Date
Reedy
ccf7d2feb4 PHPVersionCheck: Update text to match currently supported upstream PHP versions (8.1+)
Change-Id: I993a1536742c44ade2e4499247967ea4e46099dd
2024-01-13 16:57:40 +00:00
James D. Forrester
f404d44e85 Prepare active branch following REL1_41 cut, labelling as 1.42-alpha
Bug: T346925
Change-Id: If60d14681be9a0655d6948289f95389a35d5824f
2023-10-09 22:11:03 -04:00
Derick Alangi
0c4e8cab7f
PHPVersionCheck: Remove unused foreach key
This was introduced in 921343b3f9
but not used. Let's set it free even though PHP would know this,
we do too.

Change-Id: Iba523fdffd6ff038c021368d2b00407e48789b1b
2023-09-24 20:08:58 +01:00
Fomafix
b1449dbcd0 Remove deprecated HTTP header field 'Pragma'
Since RFC 9111 from June 2022 the HTTP header field 'Pragma' is
deprecated: https://www.rfc-editor.org/rfc/rfc9111.html#name-pragma

Bug: T345420
Change-Id: I6b699cd63396cad2a3dcc64516cfde5a7a64da3d
2023-09-14 19:44:46 -07:00
Fomafix
830fd4d39a Use 'Cache-Control: no-cache' instead of 'Cache-control: none'
A response directive 'none' for the HTTP header field 'Cache-Control'
is not specified in
https://www.rfc-editor.org/rfc/rfc9111.html#name-response-directives

Also use the usual capital letter for the HTTP header field name.

Change-Id: Ie1020f753f0ca319d8bbf9b6d3da70add8a1dc96
2023-09-06 10:02:20 +00:00
Waldir Pimenta
3b907c76ab Expand the PHP installation instructions
Change-Id: Ie7d19cd37fd17ea5ace8a90cd461230c0ef25b4d
2023-05-21 13:00:41 +03:00
Waldir Pimenta
6a3e33f330 Tweak "missing dependencies" message when running installer.php
Change-Id: Ibbef62f1a2548168719abf32977bca0a60e045ec
2023-05-20 23:19:53 +03:00
James D. Forrester
941cb3a13a Prepare active branch following REL1_40 cut, labelling as 1.41-alpha
Bug: T329079
Change-Id: Ia43b5da4025747cfe5c00de7121d03dd2333dfd7
2023-03-13 22:49:46 -04:00
Reedy
8898358271 .phan/config.php: Update minimum_target_php_version
Temporarily disable PhanPluginDuplicateExpressionAssignmentOperation

Bug: T319186
Change-Id: I8ae3f74f482b5de3dd74471c2e853386d1fe1091
2022-10-03 15:46:40 +01:00
James D. Forrester
c0400d480d Drop PHP 7.2 & PHP 7.3 support in MediaWiki master; require 7.4.3
This patch or its equivalent has been landed in REL1_35, REL1_36, REL1_37,
and REL1_38 for dropping PHP 7.2, and REL1_39 for dropping PHP 7.3 as well.

Now that Wikimedia servers have moved, it's time to do this for real.

Bug: T261872
Change-Id: I6627e456447ac6e3094b3bcd9c21753904170f64
2022-09-29 22:25:57 +00:00
James D. Forrester
4281c88132 Prepare active branch following REL1_39 cut, labelling as 1.40-alpha
Bug: T313920
Change-Id: If0da235a55c0379e4217bbd76adf1cbd0024e464
2022-09-05 20:30:54 -04:00
James D. Forrester
000fddc9ac Prepare active branch following REL1_38 cut, labelling as 1.39-alpha
Bug: T302909
Change-Id: Ic20da125a9252e78d704af0ef1bbca32e071523e
2022-03-14 21:50:17 -04:00
wctaiwan
e3033bb447 Tweak error message for missing composer dependencies
I tried doing this in Id9a6cf9ee2520db9d405e17eaf34b10bd72897f3 but
the error message modified in that patch was specific to the PSR-3
logging library, not for missing composer dependencies. This patch
modifies the error message for the latter as well.

Change-Id: I713a9037b8c5dc71bf03fb2ec791b3ce63e5f1be
2021-11-17 09:53:57 -08:00
Reedy
4f3570f7d8 PHPVersionCheck: Mark PHP 7.4.0 - 7.4.2 as buggy
Follows-up f28578f9da, which removed the "7.4.0 - 7.4.8" bad
range.

Bug: T246594
Change-Id: I04c33d95aa07c4234fcf4d80ed2dfeccdf579fdd
2021-10-12 20:21:38 +00:00
James D. Forrester
a0b8b4b288 Prepare for REL1_37 cut, labelling master as 1.38-alpha
Bug: T289586
Change-Id: I5d64cad0b63c1ef98cb945bb48594a22e05f50cc
2021-09-13 19:19:42 -07:00
Petr Pchelko
3e7a3554e9 Restore PHP 4.0 compatibility to PHPVersionCheck
Change-Id: Iede04d48730ce7dabe0a537a35752f59c1497e46
2021-06-07 08:24:11 -07:00
Petr Pchelko
0dfa846653 Use null coalecing operators everywhere consistenctly.
Auto-generated with rector.

Change-Id: I4f27e10cf029bb067b7bc57d82f7a64e21ea8d42
2021-06-03 21:42:06 -07:00
James D. Forrester
c791a1a4a9 Prepare for REL1_36 cut, labelling master as 1.37-alpha
Bug: T279456
Change-Id: Iffb6d982e402d998343ffa00f23bb29fba1723b9
2021-04-06 23:03:22 +00:00
Reedy
d6d48fee9e Exclude includes/PHPVersionCheck.php from phan scanning
Subset cherry pick of a patch from REL1_35
Change-Id: Ic179ae51e9508e4af8c1fe57b78daa6102534faa
2021-03-29 15:16:06 -07:00
Ammarpad
bc7c897934 PHPVersionCheck: Graceful handling for missing php-intl
MediaWiki 1.36 requires php-intl, but missing it currently
throws exception instead of graceful failure

Change-Id: Id18c45ce4da85105e4c94164cf2c6a4c5536a540
2021-03-20 11:09:15 +01:00
Tim Starling
f28578f9da Make ParserOptionsTest work on PHP<7.4.9 with opcache enabled
Instead of refusing to run MediaWiki at all, just fix the test which
fails on 7.4.3.

* Add ParserOptions::clearStaticCache(), which resets static cached
  values back to their pre-hook values.
* Add accessors for these private static variables to protect against
  access before initialisation.
* Rename "inCache" to "cacheVaryingOptionsHash" for clarity.
* In ParserOptions::match(), filter static properties by detecting them
  with ReflectionProperty, instead of making a big list of them.
* Update ParserOptionsTest for the fact that stubthreshold is no longer
  a cache-varying option. This was hidden by
  ParserOptionsTest::clearCache() injecting the wrong array into
  ParserOptions.

Bug: T270228
Change-Id: I6b5ba022e1b889a10f9fbe93da63da9831504df8
2021-03-02 13:03:58 +11:00
James D. Forrester
921343b3f9 PHPVersionCheck: Complain about known-bad versions above minimum
For now, this complains about 7.4.0 – 7.4.8, and 7.3.0 - 7.3.18.

We will back-port this to the REL1_35 live release branch with
modifications as that requires 7.3.19+ already.

Bug: T246594
Bug: T270228
Change-Id: If5c7e3c1ba9dd9f6561c1de18130ded3aadc7149
2021-02-25 15:17:21 +00:00
Reedy
d81d3de953 PHPVersionCheck: The PHP Group only support PHP >= 7.3.0
And 7.3 goes EOL (security support) 6 Dec 2021.

7.2.0 went EOL 30 Nov 2020.

https://www.php.net/supported-versions.php
https://www.php.net/eol.php

Change-Id: I23f359dbba952e882acd40a0ec3c5e8340ae47b4
2021-01-30 00:18:40 +00:00
Umherirrender
c85a43561e Improve class property documentation
Reformat existing documentation to match the format

Change-Id: I190b54b5e962f17bab6502dd1b3c02f11dc926d2
2020-10-30 10:38:58 +01:00
Thiemo Kreuz
fd7363a1e1 Fix broken PHPDoc comments that don't start with /**
Change-Id: I8db56ff0f73873864dde260e51adcd729aa74e94
2020-07-23 16:09:41 +00:00
James D. Forrester
2d7fe2d6c8 Prepare for REL1_35 cut, labelling master as 1.36-alpha
Change-Id: I91fc77a436468fa9a549383c1dac701cc5f5b6fe
2020-07-14 06:52:04 +01:00
Holger Knust
471d2371ab doxygen: Changed Doxygen tags causing warnings during documentation generation
Updated Doxygen markup in several .php files triggering warnings when mwdocgen.php is executed. Removed
obsolete settings MSCGEN_PATH and TCL_SUBST from Doxyfile. The former would generate a warning in 1.8.16
while TCL support was removed in 1.8.18. Since TCL_SUBST was blank anyway, it was removed prior to getting
to .18 in production. Increased DOT_GRAPH_MAX_NODES from 50 to 200 since Doxygen complained about it being
too low for API and Maintenance.

Bug: T248706
Change-Id: I9c67f0807d1b43089d351263d4f591dee5501f36
2020-04-14 03:25:19 +00:00
Timo Tijhof
974cbebbcd PHPVersionCheck: Refactor triggerError() to be easier to understand
* Rename $longText to $cliText.

  On the web we show a short intro and then a longer message after it.
  On the CLI, a single value controls the full output, which used to
  be $longText. This is now called $cliText to better reflect that it is
  (only) used on the CLI, and to no longer imply that the short text is
  also used there, because it isn't.

* Remove <p>-wrapping for $longHtml.
  This is now moved to the callers instead. The long message exists for the
  purpose of outputting multiple paragraphs and/or other elements (such as
  lists or tables). Wrapping this in a <p> created a awkward situation
  where the caller would have to close the implicit <p>, and then re-open
  it at the end without closing as a way to output two paragraphs.

* Make $title be text instead of raw HTML.
  This never made use of actual HTML, and it wasn't marked as such.
  It should probably have been called $titleHtml for clarity.
  To avoid having to think about this, treat it as text and escape it.

* Combine all web-facing parameters into one array, and declare their
  keys in the same order as the output.

  Previously, the order of was:
  "$title, $shortText (, $longText), $longHtml"
  Which suggested that the title is output first, followed by the short
  and long messages. In actuality, the $shortText was output first, followed
  by $title, and then the $longHtml. The $title parameter was not actually
  an overall title. Rather, it was just the title for $longHtml.
  The overall title is "Internal error" and not controlled by the caller.

  New keys match the presentation order:
  'intro', 'longTitle', and 'longHtml'.

* Remove unused "<div class=error>" element.
  This had no styling of any kind. Renders identically without it.

Test Plan:

- For each of checkRequiredPHPVersion(), checkVendorExistence() and
  checkExtensionExistence(), one at a time, change their main 'if' condition
  to be 'if ( true )' and observe that the output renders correctly.

Change-Id: If4331a37c9b62c0061dcec0a1432de320f4c4103
2020-03-02 01:46:09 +00:00
Reedy
f05872cfd6 The PHP Group stopped supporting 7.1 in late 2019
As per https://www.php.net/eol.php 7.1 was EOL and therefore
unsupported since 1 December 2019.

Change-Id: I2f6e307457365f0adf1b727b4fff9ed19c685b4f
2020-03-02 00:57:37 +00:00
James D. Forrester
00bd0d2dec Increase PHP requirement from 7.2.9 to 7.2.22 due to segfault issue
Follows 15e0e9bb4, as Parsoid code which can trigger this is reliably
is now included in MediaWiki.

Bug: T228346
Change-Id: Ia0e9d2b84534e8a03880870e0f4434426b23f47a
2020-02-24 09:55:00 -08:00
James D. Forrester
c5cc18a740 PHPVersionCheck: Simplify warning as part of dropping HHVM support
Bug: T192166
Change-Id: Ia92b881a7eeab4b8b53531136fb0dbafb6ec30ba
2019-10-10 18:15:48 -07:00
Reedy
bc6a8f58aa Set minimum PHP version to 7.2.9
Bug: T234766
Change-Id: I25206df6d7bc1587c3e18b1015603b3d264017f7
2019-10-10 20:31:54 +00:00
jenkins-bot
8838085574 Merge "PHP Version Check: Adjust wording on composer dependencies" 2019-10-07 15:29:10 +00:00
James D. Forrester
ed8e9397ad Drop HHVM support from MediaWiki
This is just a first, top-level patch for documentation and the
PHPVersionCheck class itself. Much more clean-up to follow.

Bug: T192166
Change-Id: I50f5adc8d5fff604a14c8a889a31d3b92cc568c5
2019-10-02 14:32:01 -07:00
Kosta Harlan
5dcc017371 PHP Version Check: Adjust wording on composer dependencies
The usage of "now" implies that this is a recent change.

Change-Id: Ia18d088464b65580bb1631c4d6aaf5c23c5c89ce
2019-10-02 13:22:16 +02:00
James D. Forrester
23eaa5aa95 Prepare for REL1_34 cut, labelling master as 1.35-alpha
Change-Id: Iae024da81a3808a58e17af2278e104abbcd3dd1e
2019-09-30 10:19:58 -07:00
Fomafix
bb7d9f5296 PHPVersionCheck: Consistently use double quotes for HTML attributes
Change-Id: I6130d12b34ee4dc5e5896c7fa6a7bc14b1ed9893
2019-09-22 12:19:59 +02:00
Daimona Eaytoy
e5444ea55a docs: Avoid some scalar juggling
Phan can treat scalar types as non-interchangeable with
`scalar_implicit_cast` set to false. This patch fixes some of those
issues (which are in total >1000), namely the ones with alphabetic order
< includes/actions.

Change-Id: Ib1c6573ab899088bc319b9da9ceaffc850da3dbe
2019-09-19 17:21:24 +00:00
James D. Forrester
e88526b698 Bump PHP version requirement to 7.2.0+
Bug: T216165
Bug: T216166
Change-Id: I99e45c2a8fd1512a76a42ce978cb96f39ee2456e
2019-09-16 18:14:09 -07:00
Timo Tijhof
bf206185aa Remove spurious @class tags in two files
This was only used in two PHP files in all of core. It is not
needed (the block above the class keyword is naturally for that
class) and only emits a warning from Doxygen:

> PHPVersionCheck.php:35: warning: missing argument after \class.
> SpecialPageData.php:28: warning: missing argument after \class.

This is unlike JSDuck, where it is used to differentiate a function
from a constructor/class.

In Doxygen, `@class` is only used to create a virtual class within
the docs that isn't explicitly in an indexed file, and thus
requires a name.

Bug: T232104
Change-Id: Ie504a8e2b72be8f370dc0c90da6a03f64d93df2d
2019-09-09 19:04:28 +01:00
Max Semenik
a24194d704 PHPVersionCheck: remove version_compare() existence check
It was added to PHP in 2001.

Change-Id: I3b14d726aa1cefd6b64e4bac39ef489b3c79ac1a
2019-06-14 22:23:49 +00:00
Fomafix
9cbb8f104d Use https://www.php.net/ instead of https://secure.php.net/
Change-Id: I0acca592c6909e91b28b904da49dcbd6a43cd2a5
2019-04-12 06:44:48 +02:00
James D. Forrester
4310469dd8 Prepare for REL1_33 cut, labelling master as 1.34-alpha
Change-Id: I841ee1c898a6db2e4a10b5e8c68647d45f046dc7
2019-04-10 16:50:58 -07:00
Kunal Mehta
e604abd49a Fix PhanPluginDuplicateConditional* errors (#1)
Change-Id: I61e4d4a60dda27f43debab71a9c02f14c1468311
2019-03-23 18:06:35 -07:00
James D. Forrester
60a172aaea Update required PHP version to 7.0.13
Bug: T209423
Change-Id: I66e563adb062bc132a1092d78bfd06e2210f382e
2019-02-14 11:29:48 -08:00
Timo Tijhof
e6763161e7 PHPVersionCheck: Remove obsolete load.php code and simplify
* Remove obsolete handling for 'load.php', which no longer
  uses this check. This hasn't been used for several releases.

* Remove the 'entryPoint' parameter in favour of 'format',
  which it was already a proxy for.

* Move the double dirname() logic to mw-config/index.php.

Bug: T189966
Change-Id: I343216442475d36e61213900f196ab6ec5f6b747
2018-10-28 14:12:54 -07:00
Alangi Derick
edc5a90da1 Add docs and minor cleanup in PHPVersionCheck.php
- Consistency of the acronym PHP instead of "php".
- Add documentation to $functionsExtensionsMapping.

Change-Id: I06b507128bc3b95605a764cd63f621dbae3b2dc3
2018-10-18 18:56:16 +01:00
James D. Forrester
6e04121078 Prepare for REL1_32 cut, labelling master as 1.33-alpha
Change-Id: I41c19a63d20dc4e734430ad4fe989fa5a9e18d62
2018-10-15 14:58:59 -07:00
Alangi Derick
1c920468f6 Fix common typo "MediWiki" in MW core
Fixed typo "MediWiki" to "MediaWiki" in core.

Bug: T201491
Change-Id: I55cb4af63b72cfa08de079544c43ae9f1366a457
2018-08-14 21:07:43 +00:00
Umherirrender
9e7ca073ea Whitelist phpcs Squiz.Scope.MemberVarScope in PHPVersionCheck
The class supports php4 and the visibility private does not work there.

Change-Id: I9cbffe437a1d1f4243f0b70bd881cdc8b8257537
2018-08-07 12:39:46 +02:00