MediaWiki master
VersionChecker.php
Go to the documentation of this file.
1<?php
6namespace MediaWiki\Composer;
7
8use Composer\Composer;
9use RuntimeException;
10
18 public static function onEvent() {
19 $version = Composer::VERSION;
20 if ( $version === '@package_version@' ) {
21 // In Composer 1.9+, unreleased git branches have this value in Composer::VERSION,
22 // and Composer::getVersion() was introduced to work around this.
23 $version = Composer::getVersion();
24 }
25 if ( version_compare( $version, '2.0.0', '<' ) ) {
26 throw new RuntimeException(
27 "MediaWiki requires Composer version 2 or later; version 1"
28 . " has been considered end of life since October 2020!"
29 );
30 }
31 }
32}
Checks the version of Composer that this is being run on, and aborts if not version 2 or later.
Copyright (C) 2017 Kunal Mehta legoktm@debian.org