I have a silly doubt with regard to autoloading…
There is an ‘extensions’ folder with many php files. If i specify
in the main.php file, am i importing all the files in the ‘extensions’ folder at that instant itself, or will the files be autoloaded as and when referenced.
The doubt has risen because of the way i am understanding the following line in the Yii docs:
‘importing a class is much lighter because it only includes the class file when the class is referenced the first time’.
Yeah only when the class is first mentioned in the code, that array in the config just tells the Yii autoloader where to look.
Actually it adds a directory into php include path. But if this is disallowed, Yii will try to find a file anyway.
But it’s still autoloaded, right? It just adds to the PHP include path, which the Yii autoloader uses I thought.