Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

(no description)

File Size: 148 lines (5 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Psr4Autoloader:: (5 methods):
  register()
  addNamespace()
  loadClass()
  loadMappedFile()
  requireFile()


Class: Psr4Autoloader  - X-Ref

Class Psr4Autoloader

register()   X-Ref
Register loader with SPL autoloader stack.

return: void

addNamespace($prefix, $baseDir, $prepend = false)   X-Ref
Adds a base directory for a namespace prefix.

return: void
param: string $prefix The namespace prefix.
param: string $baseDir A base directory for class files in the
param: bool $prepend If true, prepend the base directory to the stack

loadClass($class)   X-Ref
Loads the class file for a given class name.

return: mixed The mapped file name on success, or boolean false on
param: string $class The fully-qualified class name.

loadMappedFile($prefix, $relativeClass)   X-Ref
Load the mapped file for a namespace prefix and relative class.

return: mixed Boolean false if no mapped file can be loaded, or the
param: string $prefix The namespace prefix.
param: string $relativeClass The relative class name.

requireFile($file)   X-Ref
If a file exists, require it from the file system.

return: bool True if the file exists, false if not.
param: string $file The file to require.