MediaWiki  master
AutoLoader Class Reference

Locations of core classes Extension classes are specified with $wgAutoloadClasses. More...

Static Public Member Functions

static autoload ( $className)
 autoload - take a class name and attempt to load it More...
 
static find ( $className)
 Find the file containing the given class. More...
 
static getAutoloadNamespaces ()
 Get a mapping of namespace => file path The namespaces should follow the PSR-4 standard for autoloading. More...
 
static resetAutoloadLocalClassesLower ()
 Method to clear the protected class property $autoloadLocalClassesLower. More...
 

Static Public Attributes

static string[] $psr4Namespaces = []
 

Static Protected Attributes

static $autoloadLocalClassesLower = null
 

Detailed Description

Locations of core classes Extension classes are specified with $wgAutoloadClasses.

Definition at line 31 of file AutoLoader.php.

Member Function Documentation

◆ autoload()

static AutoLoader::autoload (   $className)
static

autoload - take a class name and attempt to load it

Parameters
string$classNameName of class we're looking for.

Definition at line 113 of file AutoLoader.php.

References find().

◆ find()

static AutoLoader::find (   $className)
static

Find the file containing the given class.

Parameters
string$classNameName of class we're looking for.
Returns
string|null The path containing the class, not null if not found

Definition at line 46 of file AutoLoader.php.

References $file, $IP, $wgAutoloadAttemptLowercase, $wgAutoloadClasses, $wgAutoloadLocalClasses, and wfDebugLog().

Referenced by autoload(), and FindClasses\execute().

◆ getAutoloadNamespaces()

static AutoLoader::getAutoloadNamespaces ( )
static

Get a mapping of namespace => file path The namespaces should follow the PSR-4 standard for autoloading.

See also
https://www.php-fig.org/psr/psr-4/
Access: internal
Only public for usage in AutoloadGenerator
Since
1.31
Returns
string[]

Definition at line 139 of file AutoLoader.php.

◆ resetAutoloadLocalClassesLower()

static AutoLoader::resetAutoloadLocalClassesLower ( )
static

Method to clear the protected class property $autoloadLocalClassesLower.

Used in tests.

Definition at line 125 of file AutoLoader.php.

Member Data Documentation

◆ $autoloadLocalClassesLower

AutoLoader::$autoloadLocalClassesLower = null
staticprotected

Definition at line 32 of file AutoLoader.php.

◆ $psr4Namespaces

string [] AutoLoader::$psr4Namespaces = []
static
Access: internal
Only public for ExtensionRegistry Namespace (ends with \) => Path (ends with /)

Definition at line 38 of file AutoLoader.php.

Referenced by ExtensionRegistry\exportAutoloadClassesAndNamespaces(), ExtensionRegistry\exportExtractedData(), and ExtensionRegistry\exportTestAutoloadClassesAndNamespaces().


The documentation for this class was generated from the following file: