Commit graph

11 commits

Author SHA1 Message Date
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
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
2018-05-30 18:06:13 -07:00
WMDE-Fisch
6df9ed1ad6 update mediawiki-codesniffer to 0.11.0 and fix issues
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
2017-08-11 22:27:51 +02:00
Kunal Mehta
75fefc066b checkComposerLockUpToDate: Always check dependencies
Upstream composer has replaced the 'hash' with a smarter 'content-hash',
but instead of re-implementing (or copy-pasting) all of that in MediaWiki
we can just compare the dependencies themselves, since that's all we
care about.

Bug: T147189
Change-Id: Ic2f22a82699e2b707b6ccb355605999a183a56a0
2016-10-16 12:49:41 -07: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
Florian
9dec78d4c0 convertExtensionToRegistration: Detect if composer autoloader is needed
If an extension specifies a require section in its composer.json, which contains
some dependencies, we can assume that this extension needs to load the composer
autoloader.

The maintenance script convertExtensionToRegistration.php will now check if the
extension has such a composer.json and, if so, adds the load_composer_autoloader
property in extension.json, which will try to load the autoloader of composer
is it is present.

Also add a check for existence of a require section in ComposerJson library
(ComposerJson::getRequiredDependencies()). 

Bug: T119766
Change-Id: Icdbc37abc44e642afee2aab4c0e9298d3471124d
2016-01-07 17:23:34 +00:00
Perside Rosalie
6ba942258a Changed paths to package dependency file
Paths to ./composer.lock is changed to ./vendor/composer/installed.json
and dependency information now is read from the installed.json file.
A new ComposerInstalled class has been declared and uses the class now
to access the getInstalledDependencies() method to read data

Bug: T106247
Change-Id: Ic216577bb19b4fc5832ba003fcbbe9195d707b41
2015-10-26 15:58:03 +00:00
Kunal Mehta
4345629526 Improve appearance of libraries on Special:Version
* Added licenses
* Added description (will always be in English)
* Added authors
* Bold library name, like we do with extensions and skins

Change-Id: I880756b489fb5a3f81d398d32162a186a1b919d8
2015-06-26 21:26:05 +00:00
Kunal Mehta
8e25f1e167 ComposerJson: Ignore dependencies that start with "ext-"
Any requirements of MediaWiki core to depend upon PHP extensions should
be handled in the installer rather than checkComposerLockUpToDate.php, which
doesn't work anyways since PHP extensions are not included in the lock file.

Change-Id: Ib7af7ccf2f10bc941222d1ce534c7c20690b4c6f
2015-02-23 10:34:53 -08:00
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Kunal Mehta
17ccfbb7b3 Don't display composer installed extensions/skins on Special:Version
Extensions and skins should already be adding their credits through
$wgExtensionCredits, meaning that they would be duplicated in the
"Installed libraries" section.

Anything that has a type that begins with "mediawiki-" will now
be skipped.

Release notes were added for this commit and 528297f8db.

Change-Id: Ie873b16c1a8a696c7de833ae69b263161d9e15a8
2015-01-05 15:58:43 +00:00
Kunal Mehta
ce49874d9f Add checkComposerLockUpToDate.php script
Checks whether your composer.lock file is up to date
with the current composer.json file.

Bug: T77388
Change-Id: I528d63172c238cf1ea9bc02e8eb39b93225865de
2014-12-29 23:20:30 +00:00