MediaWiki REL1_31
MediaWikiVersionFetcher.php
Go to the documentation of this file.
1<?php
2
10
17 public function fetchVersion() {
18 $code = file_get_contents( __DIR__ . '/Defines.php' );
19
20 $matches = [];
21 preg_match( "/define\‍( 'MW_VERSION', '([0-9a-zA-Z\.\-]+)'/", $code, $matches );
22
23 if ( count( $matches ) !== 2 ) {
24 throw new RuntimeException( 'Could not extract the MediaWiki version from Defines.php' );
25 }
26
27 return $matches[1];
28 }
29
30}
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
fetchVersion()
Get the MediaWiki version, extracted from the PHP source file where it is defined.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition hooks.txt:865