Class aliases

Local plugins ::: local_classalias
Maintained by Mark Sharp
Development utility for users of VSCode. Aliased classes are not picked up by VSCode, so this prevents VSCode red-lining valid code.

Class aliases 1.1

Moodle 4.5, 5.0
Released: Friday, September 5, 2025, 5:52 PM

Class Aliases

This is intended for development purposes only.

Moodle has started namespacing lots of old classes using the class_alias function.

Trouble is VSCode doesn't recognise these class aliases as they are only parsed at runtime (apparently this isn't a problem in PHPStorm).

To work-around this, this plugin uses "extends" to link the old class name with the new one. It isn't intended for the code to see these extends, so they are simply listed in a file that is not read. VScode will read them though.

Eventually, these class_alias mappings will be dropped, so do migrate any instances you find in your code, rather than relying on this mapping.

Version information

Version build number
2024101701
Version release name
1.1
Maturity
Stable version
MD5 Sum
fe573a237de4a8aa6446d1a2e863e8bd
Supported software
Moodle 4.5, Moodle 5.0
  • Latest release for Moodle 4.5
  • Latest release for Moodle 5.0

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS tag
v1.1

Default installation instructions for plugins of the type Local plugins

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation.