| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the possibility for extensions and skins to require
certain environment abiltites that are not necessarily PHP extensions.
For now, the only ability introduced is the ability to shell out, but
the processing and testing is written in a more general way to allow
users to add more abilties later on by just changing getAbilities().
In theory, this allows using VersionChecker to check for random
abilities if they are specified in the constructor, as it is comletely
environment agnostic and not really bound to just be used for checking
extension compatibility.
Furthermore, it is possible to specify custom error messages for each of
these abilities in the constructor. Other parts of MediaWiki may use
these features to check for requirements while working with totally
different abilities.
Bug: T212472
Change-Id: Iff8512530b08ef509e7ac0b6ed8fe9578ef3e2a1
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I610dfafcd180f89ee0e786f4516f9eb9c63a42b4
|
|/
|
|
|
|
|
|
|
| |
$this->attributes is an array class property that gets set by the
method extractInfo(). This method really doesn't return an array
though in a sense $this->attributes gets set which can be used but
it's not returned.
Change-Id: I54e8065c63f81016425c7dd40ce87e1eb8ba0830
|
|
|
|
| |
Change-Id: I7abd09d8959daddaa161bd92a1b1b23a4abbab32
|
|
|
|
| |
Change-Id: I54d94f4369eb4fa0b0ebe892a1d6cc57b2bdb1f9
|
|
|
|
|
| |
Bug: T126091
Change-Id: I27ecebe27d7aaebe6d1317bc5eaea9cca368b45d
|
|
|
|
|
|
|
| |
MW_PHPUNIT_TEST will always be defined during tests, so we can't have a
test that requires it to be undefined.
Change-Id: I67b011af31026bc9c568725f8f294359b63f2fd5
|
|
|
|
|
|
|
|
|
|
| |
ExtensionRegistry is a rather special singleton that can't use the normal
MediaWikiServices reset due to its early initialization, so introduce
a ->setAttributeForTest method to override attributes that are typically
loaded from extension.json.
Bug: T200013
Change-Id: I9e62a02ed2044c847e9ab2dcdfab094001f88986
|
|
|
|
| |
Change-Id: I9722c065d522e18b6bf488c721f48ee7b7b9e494
|
|
|
|
| |
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
|
|
|
|
|
|
|
|
|
|
| |
This change adds the possibility to specify ext-* keys under the 'platform'
key introduced in I6744cc0be2 to require given PHP extensions. Note that
it's impossible to add constraints different from '*', as there is no universal
way to retrieve PHP extension versions.
Bug: T197535
Change-Id: I510de1e6d80f5c1d92dc1d1665aaa6c25bf28bf7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While MediaWiki Core already sets requirements for PHP versions, it should be
possible for extensions to tighten these requirements. This mirrors the PHP
parameter of extension infoboxes as well.
This change introduces a new 'platform' key (in addition to 'MediaWiki', 'skins'
and 'extensions', where non-MediaWiki software requirements will be listed
in the future, starting with a PHP version constraint. Further keys are
supposed to be added to allow setting constraints against php extensions
and other abilities of the platform.
Bug: T197535
Change-Id: I6744cc0be2363b603331af9dc860eb8603a1a89a
|
|
|
|
| |
Change-Id: Iba5df6fe8c647baaaff91df311efec22cca7e88f
|
|\
| |
| |
| | |
loaded"
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As it's quite common that extensions and skins interact with each other, it's
useful to have a simple way to check if an extension version satisfies a
given constraint, as extensions change over time.
Bug: T202955
Change-Id: I19f9713caf89d647072a2bd7d598e739be383f4a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Most extensions depend upon any version of other extensions/skins since
versioning is pretty inconsistent. Since '*' is so commonly used, explicitly
short-circuit that constraint since we only need to check whether the
dependency is loaded.
Bug: T198044
Change-Id: I5526c8068d3b9a6ee5ca71ea6bdbcd693f1ffb7a
|
|/
|
|
|
| |
Bug: T45646
Change-Id: Ib16db04e499ad28216ee08b8cccccf3f141e2bad
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use of global variables was deprecated in favour of
ResourceLoaderModule::getLessVars() on a per-module basis.
Also moved testLessFileCompilation case to the appropiate file as it
covers ResourceLoaderFileModule.php, not ResourceLoader.php.
Bug: T140804
Depends-On: Ib1b2808df2384473bfac47f53a5d25d7c9bbca2b
Depends-On: I96047f69d01c4736306df2719267e6347daf556f
Change-Id: If708087c85c80355c7e78f1768529b5f2e16ed07
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, the ExtensionProcessor processes the config array of the
extension and just sets the value as a global. In this way, however,
the metadata of the configs (description, public, ...) aren't available.
This change exposes the configurations in the extracted data as the
config key.
Bug: T155908
Change-Id: Ie41e6ecb8d08a5b20b56eb2281af1dfdd808b2c4
|
| |
| |
| |
| | |
Change-Id: Ic37544de1400600719764057a63cc546c26218d8
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The JSON specification permits duplicate keys, but doing so is almost
always nearly a mistake.
We can use the JSON lint library (added as
dev-requirement to composer), which is now also used to decode the
JSON (as it's the same step as validating the JSON).
Bug: T153507
Change-Id: Ia713a1906169333c1aa2aebdc0ed060d26428d72
|
|/
|
|
|
|
|
|
| |
Instead of using "skin" to check for skin dependencies, extension registration
now uses the correct key "skins" (from the schema).
Bug: T197478
Change-Id: I382fc79229e1406786f444192e6e3e3bde44d224
|
|
|
|
|
|
|
| |
ObjectCache::newFromId() now throws an InvalidArgumentException if the
specific id can't be found.
Change-Id: Idcb0f2158a38555c1ec1681ba0635c7903e48718
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When creating Docker images of MediaWiki using the Bazel build system, I
noticed that I'm not able to load any extensions. This is due to the
fact that Bazel always generates container layers with mtimes of files
set to 1970-01-01 for determinism/reproducibility.
Relax the check a bit to only fail when the mtime is false, which
happens when filemtime() fails.
Bug: T196672
Change-Id: Ieaeb3113a7d9c44f29cca2d062c5bb11ebeada0d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '
(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)
Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).
Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
readFromQueue() injects the content of AutoloadClasses to
$wgAutoloadClasses however it missed doing the same for
AutoloadNamespaces.
When using the installer with an extension having AutoloadNamespaces
set, its classes would not be found.
Make ExtensionRegistry append to AutoLoader::$psr4Namespaces, and add
a test to cover the new behavior.
Bug: T195783
Change-Id: Id61155867a4ca7d9bc4a347f8671da74b0fa490b
|
|
|
|
|
|
|
|
|
| |
If the "url" field in extension.json is pointing to mediawiki.org,
perform some extra validation steps:
* Require HTTPS
* Require the `www.mediawiki.org` canonical domain
Change-Id: I3371443d3f6c76f53437adf90a700969bba7d0e7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't keep track of what set a specific global, so at least mention
the name of the extension that is setting a duplicate for easier
debugging.
Also, fix the case where if the first extension to be loaded was setting
a core setting, it would not throw an exception since config was being
processed before the rest of extension.json. Now we process config after
all core settings, going only before attributes.
Bug: T194319
Change-Id: I4fd96e7d167cf0652ee3e8e66167c86f2b91b992
|
|
|
|
|
|
| |
Bug: T153256
Bug: T190425
Change-Id: I749f66d13a8c8a8ae4a83661b83c56f0db74a187
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I7f7445952f057995a3e3215145803affa5aceede
|
|
|
|
|
|
|
|
| |
This is unused, and it would make more sense for whatever wants to add
credits to directly modify $this->loaded instead of incurring the
overhead of an extra function call.
Change-Id: Icce1a87d2dc8ce61cb05eace6e0b65d6cea4c58d
|
|
|
|
| |
Change-Id: I883a502fc3ed6cd7b8651d9e5e78dba7177ead9c
|
|
|
|
|
|
|
| |
And fix a few typos in the error messages and the accidental inclusion
of whitespace.
Change-Id: I4ea90c5543e394c3f30b1da1456e4676377188f7
|
|
|
|
|
|
|
|
| |
The code for ParserTestFiles and ServiceWiringFiles was identical, so
unify it into one function. For most extensions, this should save two
unnecessary function calls as a bonus.
Change-Id: If5ed189f97b7d3b9cd7b550f3ad2e90abe30005d
|
|
|
|
|
|
|
|
|
|
|
|
| |
The highest manifest version is not supported from the start of
extension.json
For extensions converted to this highest version the mininum core
version must be specified to avoid load problems in the extension.
Using 1.29.0 for manifest version 2 due to T149757 /
Id1071fc0647892438e5cd0e3ee621fbdaaa64014
Change-Id: Iea5ba589c70958db7500cf3587b5ebd738532026
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$foo = null; isset( $foo ); will yield false.
Sometimes we want to explicitly set a config to null, but ExtensionRegistry
is then overriding this variable with the default value.
This is no consistent with the old workflow:
require_once the extension and then override the setting with null.
Bug: T128661
Change-Id: I0654c9369a596e84591fcaa9643703e6b4ccf57e
|
|
|
|
|
|
|
|
| |
Courtesy of the PhpStorm inspection Case mismatch in method call or
class usage.
Bug: T166759
Change-Id: I27c53658b99048fa0dd8f9d6ef1398620386e1cc
|
|
|
|
|
|
|
| |
operations
Bug: T182645
Change-Id: Ia98b1d798b1f93ca30686c009d479668616229ae
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for a PSR-4 (<http://www.php-fig.org/psr/psr-4/>)
autoloader, so instead of needing to manually list each class, just the
namespace prefix is needed.
Extensions can set a "AutoloadNamespaces" property in extension.json to
register PSR-4 compatible namespaces to be autoloaded.
The implementation is based off of the example implementation
(<http://www.php-fig.org/psr/psr-4/examples/>) with some modifications
for performance, notably cutting down on function calls, and only trying
to look up classes that are namespaced.
The generateLocalAutoload.php script will ignore any directory that is
registered as a PSR-4 namespace.
Bug: T99865
Bug: T173799
Change-Id: Id095dde37cbb40aa424fb628bd3c94e684ca2f65
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ExtensionProcessor would previously just blindly overwrite duplicate
config settings, which ends up depending upon load order.
It's relatively hard to debug since it is silently overwritten. This now
throws exceptions in case of duplicate config settings.
This will also have some side-effects of catching people putting things
like "ResourceModules" in their "config" section when it should be a
top-level item.
Bug: T152929
Depends-On: I4c5eaf87657f5dc07787480a2f1a56a1db8c714f
Change-Id: Ieeb26011e42c741041d2c3252238ca0823b99eb4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move the file_exists() check out of the extension processor and into the
extension registry so that it is evaluated at run time instead of during
caching. The prior way is problematic since we don't invalidate the
cache if the existence of the file were to change.
Bug: T176534
Change-Id: I98e4ffdfac9f98397a103966824519afe1375356
|
| |
| |
| |
| | |
Change-Id: Ic4f0eb5f05504922c20213e1d321fa14c979b6f8
|
|/
|
|
|
|
|
|
| |
Getting the following error for an invalid callback is not helpful:
Warning: Invalid argument: function: class not found in
/includes/registration/ExtensionRegistry.php on line 335
Change-Id: I4dfc011cb0a5cd06f1836d73e58f407d468e4546
|
|
|
|
|
|
|
|
| |
Breaks mergeMessageFileList which means scap can't run in beta.
This reverts commit 50d7546057c1089228a2a6d7d4a49d78d72887e3.
Change-Id: Idb65f1098abce28d49ebbcc8254c0976b6861c59
|