MediaWiki
REL1_32
MediaWikiVersionFetcher.php
Go to the documentation of this file.
1
<?php
2
9
class
MediaWikiVersionFetcher
{
10
17
public
function
fetchVersion
() {
18
$defaultSettings = file_get_contents( __DIR__ .
'/DefaultSettings.php'
);
19
20
$matches
= [];
21
preg_match(
"/wgVersion = '([0-9a-zA-Z\.\-]+)';/"
, $defaultSettings,
$matches
);
22
23
if
( count(
$matches
) !== 2 ) {
24
throw
new
RuntimeException(
'Could not extract the MediaWiki version from DefaultSettings.php'
);
25
}
26
27
return
$matches
[1];
28
}
29
30
}
$matches
$matches
Definition
NoLocalSettings.php:24
MediaWikiVersionFetcher
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
Definition
MediaWikiVersionFetcher.php:9
MediaWikiVersionFetcher\fetchVersion
fetchVersion()
Returns the MediaWiki version, in the format used by MediaWiki's wgVersion global.
Definition
MediaWikiVersionFetcher.php:17
includes
MediaWikiVersionFetcher.php
Generated on Mon Nov 25 2024 15:57:25 for MediaWiki by
1.10.0