28require_once __DIR__ .
'/../autoload.php';
62 $lowerClass = strtolower( $className );
64 if ( self::$autoloadLocalClassesLower ===
null ) {
68 if ( isset( self::$autoloadLocalClassesLower[$lowerClass] ) ) {
69 if ( function_exists(
'wfDebugLog' ) ) {
70 wfDebugLog(
'autoloader',
"Class {$className} was loaded using incorrect case" );
72 $filename = self::$autoloadLocalClassesLower[$lowerClass];
76 if ( !$filename && strpos( $className,
'\\' ) !==
false ) {
79 while (
false !== $pos = strrpos( $prefix,
'\\' ) ) {
81 $prefix = substr( $className, 0, $pos + 1 );
82 if ( isset( self::$psr4Namespaces[$prefix] ) ) {
83 $relativeClass = substr( $className, $pos + 1 );
85 $file = self::$psr4Namespaces[$prefix] .
'/' .
86 str_replace(
'\\',
'/', $relativeClass ) .
'.php';
87 if ( file_exists(
$file ) ) {
94 $prefix = rtrim( $prefix,
'\\' );
104 if ( substr( $filename, 0, 1 ) !=
'/' && substr( $filename, 1, 1 ) !=
':' ) {
106 $filename =
"$IP/$filename";
117 self::$autoloadLocalClassesLower =
null;
132 'MediaWiki\\Auth\\' => __DIR__ .
'/auth/',
133 'MediaWiki\\Block\\' => __DIR__ .
'/block/',
134 'MediaWiki\\Edit\\' => __DIR__ .
'/edit/',
135 'MediaWiki\\EditPage\\' => __DIR__ .
'/editpage/',
136 'MediaWiki\\Linker\\' => __DIR__ .
'/linker/',
137 'MediaWiki\\Message\\' => __DIR__ .
'/Message',
138 'MediaWiki\\Permissions\\' => __DIR__ .
'/Permissions/',
139 'MediaWiki\\Preferences\\' => __DIR__ .
'/preferences/',
140 'MediaWiki\\Rest\\' => __DIR__ .
'/Rest/',
141 'MediaWiki\\Revision\\' => __DIR__ .
'/Revision/',
142 'MediaWiki\\Session\\' => __DIR__ .
'/session/',
143 'MediaWiki\\Shell\\' => __DIR__ .
'/shell/',
144 'MediaWiki\\Sparql\\' => __DIR__ .
'/sparql/',
145 'MediaWiki\\Storage\\' => __DIR__ .
'/Storage/',
146 'MediaWiki\\Tidy\\' => __DIR__ .
'/tidy/',
147 'Wikimedia\\Message\\' => __DIR__ .
'/libs/Message/',
148 'Wikimedia\\ParamValidator\\' => __DIR__ .
'/libs/ParamValidator/',
149 'Wikimedia\\Services\\' => __DIR__ .
'/libs/services/',
155spl_autoload_register( [
'AutoLoader',
'autoload' ] );
$wgAutoloadAttemptLowercase
Switch controlling legacy case-insensitive classloading.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
$wgAutoloadClasses['ReplaceTextHooks']
global $wgAutoloadLocalClasses
Locations of core classes Extension classes are specified with $wgAutoloadClasses This array is a glo...
static getAutoloadNamespaces()
Get a mapping of namespace => file path The namespaces should follow the PSR-4 standard for autoloadi...
static $autoloadLocalClassesLower
static string[] $psr4Namespaces
static autoload( $className)
autoload - take a class name and attempt to load it
static resetAutoloadLocalClassesLower()
Method to clear the protected class property $autoloadLocalClassesLower.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.