I know symfony can autoload files with spl_auto_register
,but is it clever enough?
If only a.php is needed to load,will it also load b.php?
I know symfony can autoload files with spl_auto_register
,but is it clever enough?
If only a.php is needed to load,will it also load b.php?
The autoloader will only load the files necessary to instantiate a requested class.
The autoloader works by storing an array of key value pairs such that
classname => /full/path/to/class
In symfony 1.3/1.4 two cache files get created. One for the core classes, created by sfCoreAutoload, and stored in /cache/project.autoload. For the classes that are autoloaded from within your project directory, the array of key value pairs is stored in */cache/app/_env_/config/config_autoload.yml.php*. This file is generated by the config handler sfAutoloadConfigHandler.
Some useful points to remember: