.
Dynamic loading | dikini.net
by vlado on Tue, 2006-07-25 11:21
- Intent
- Keep working set small and mainatin fast start time by loading features as required
- Implementation
- use __autoload()
- Example
function autoload( $classname) {
list($path,$file) = loadpath( $classname );
require_once "$path/$file";
}
- Notes
- we are loading a file, based on some conventions interpreted in loadpath
- This can be used to implement module-like system, but the lack of subclasses or similar tools makes the 'module' bindings always transparent