Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(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.

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
return: void

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

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

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

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

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

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