MediaWiki
REL1_39
MediaWikiVersionFetcher.php
Go to the documentation of this file.
1
<?php
2
9
class
MediaWikiVersionFetcher
{
10
17
public
function
fetchVersion
() {
18
$code = file_get_contents( __DIR__ .
'/Defines.php'
);
19
20
if
( !preg_match(
"/define\( 'MW_VERSION', '([^']+)'/"
, $code,
$matches
) ) {
21
throw
new
RuntimeException(
'Could not extract the MediaWiki version from Defines.php'
);
22
}
23
24
return
$matches
[1];
25
}
26
27
}
$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()
Get the MediaWiki version, extracted from the PHP source file where it is defined.
Definition
MediaWikiVersionFetcher.php:17
includes
MediaWikiVersionFetcher.php
Generated on Sun Nov 24 2024 20:23:44 for MediaWiki by
1.10.0