MediaWiki master
VersionChecker.php
Go to the documentation of this file.
1<?php
19namespace MediaWiki\Composer;
20
21use Composer\Composer;
22use RuntimeException;
23
31 public static function onEvent() {
32 $version = Composer::VERSION;
33 if ( $version === '@package_version@' ) {
34 // In Composer 1.9+, unreleased git branches have this value in Composer::VERSION,
35 // and Composer::getVersion() was introduced to work around this.
36 $version = Composer::getVersion();
37 }
38 if ( version_compare( $version, '2.0.0', '<' ) ) {
39 throw new RuntimeException(
40 "MediaWiki requires Composer version 2 or later; version 1"
41 . " has been considered end of life since October 2020!"
42 );
43 }
44 }
45}
Checks the version of Composer that this is being run on, and aborts if not version 2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...