MediaWiki
master
MediaWikiVersionFetcher.php
Go to the documentation of this file.
1
<?php
2
11
class
MediaWikiVersionFetcher
{
12
19
public
function
fetchVersion
() {
20
$code = file_get_contents( __DIR__ .
'/../Defines.php'
);
21
22
if
( !preg_match(
"/define\( 'MW_VERSION', '([^']+)'/"
, $code,
$matches
) ) {
23
throw
new
RuntimeException(
'Could not extract the MediaWiki version from Defines.php'
);
24
}
25
26
return
$matches
[1];
27
}
28
29
}
$matches
$matches
Definition
NoLocalSettings.php:27
MediaWikiVersionFetcher
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
Definition
MediaWikiVersionFetcher.php:11
MediaWikiVersionFetcher\fetchVersion
fetchVersion()
Get the MediaWiki version, extracted from the PHP source file where it is defined.
Definition
MediaWikiVersionFetcher.php:19
includes
composer
MediaWikiVersionFetcher.php
Generated on Thu Sep 12 2024 21:23:07 for MediaWiki by
1.10.0