The class_alias function seems to load the class into memory immediately when the statement executes instead of the first time the class is actually used. Is it possible / recommended to setup some kind of lazy loading mechanism for class aliases?
For instance, perhaps store the the aliases in an array, and in an __autoload function check that array and define the alias when the class is actually used.
The simple answer is to not use the function to alias classes, but use the
useconstruct:That will be lazy loaded.