MediaWiki REL1_39
|
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 | |
static | find ( $className) |
Find the file containing the given class. | |
static | getClassFiles () |
Returns a map of class names to file paths for testing. | |
static | getNamespaceDirectories () |
Returns a map of namespace names to directories, per PSR4. | |
static | getState () |
Returns an array representing the internal state of Autoloader, so it can be remembered and later restored during testing. | |
static | loadFile (string $file) |
Load a file that declares classes, functions, or constants. | |
static | loadFiles (array $files) |
Batch version of loadFile() | |
static | registerClasses (array $files) |
Register a file to load the given class from. | |
static | registerNamespaces (array $dirs) |
Register a directory to load the classes of a given namespace from, per PSR4. | |
static | resetAutoloadLocalClassesLower () |
Method to clear the protected class property $autoloadLocalClassesLower. | |
static | restoreState ( $state) |
Returns an array representing the internal state of Autoloader, so it can be remembered and later restored during testing. | |
Public Attributes | |
const | CORE_NAMESPACES |
A mapping of namespace => file path for MediaWiki core. | |
Static Public Attributes | |
static string[] | $psr4Namespaces = self::CORE_NAMESPACES |
Namespace (ends with \) => Path (ends with /) | |
Locations of core classes Extension classes are specified with $wgAutoloadClasses.
Definition at line 31 of file AutoLoader.php.
|
static |
autoload - take a class name and attempt to load it
string | $className | Name of class we're looking for. |
Definition at line 240 of file AutoLoader.php.
|
static |
Find the file containing the given class.
string | $className | Name of class we're looking for. |
Definition at line 167 of file AutoLoader.php.
References $wgAutoloadLocalClasses, and wfDebugLog().
Referenced by FindClasses\execute().
|
static |
Returns a map of class names to file paths for testing.
Definition at line 268 of file AutoLoader.php.
|
static |
Returns a map of namespace names to directories, per PSR4.
Definition at line 286 of file AutoLoader.php.
|
static |
Returns an array representing the internal state of Autoloader, so it can be remembered and later restored during testing.
Definition at line 298 of file AutoLoader.php.
|
static |
Load a file that declares classes, functions, or constants.
The file will be loaded immediately using require_once in function scope.
string | $file | the path of the file to load. |
Definition at line 142 of file AutoLoader.php.
|
static |
Batch version of loadFile()
string[] | $files | the paths of the files to load. |
Definition at line 155 of file AutoLoader.php.
Referenced by ExtensionRegistry\exportExtractedData(), and Installer\getAutoExtensionData().
|
static |
Register a file to load the given class from.
string[] | $files | a map of qualified class names to file names |
Definition at line 122 of file AutoLoader.php.
Referenced by ExtensionRegistry\exportExtractedData(), and Installer\getAutoExtensionData().
|
static |
Register a directory to load the classes of a given namespace from, per PSR4.
string[] | $dirs | a map of namespace (ends with \) to path (ends with /) |
Definition at line 112 of file AutoLoader.php.
Referenced by ExtensionRegistry\exportExtractedData(), and Installer\getAutoExtensionData().
|
static |
Method to clear the protected class property $autoloadLocalClassesLower.
Used in tests.
Definition at line 252 of file AutoLoader.php.
|
static |
Returns an array representing the internal state of Autoloader, so it can be remembered and later restored during testing.
array | $state | A state array returned by getState(). |
Definition at line 314 of file AutoLoader.php.
|
static |
Namespace (ends with \) => Path (ends with /)
Definition at line 97 of file AutoLoader.php.
const AutoLoader::CORE_NAMESPACES |
A mapping of namespace => file path for MediaWiki core.
The namespaces should follow the PSR-4 standard for autoloading
Definition at line 41 of file AutoLoader.php.