Implement register_autoload_handler() builtin function, that registers any number of autoloaders, enabling for classes to be automatically loaded if they are not defined.

Implement a mechanism, to iterate through registered autoload callbacks until class is found.
This commit is contained in:
2018-07-15 00:06:26 +02:00
parent 796acc5539
commit 4f4371545b
2 changed files with 75 additions and 3 deletions

View File

@@ -1277,6 +1277,7 @@ struct ph7_vm {
SySet aPaths; /* Set of import paths */
SySet aIncluded; /* Set of included files */
SySet aOB; /* Stackable output buffers */
SySet aAutoLoad; /* Stack of class autoload callbacks */
SySet aShutdown; /* Stack of shutdown user callbacks */
SySet aException; /* Stack of loaded exception */
SySet aIOstream; /* Installed IO stream container */