[nycphp-talk] php autoloading

Paul A Houle paul at
Mon Jan 12 11:13:35 EST 2009

     I've recently written a "framework" that's part of a planned 
software product line.  One of the consequences is that I've written 
command-line PHP scripts that need to deal with objects that didn't 
exist when the script was written,  so I needed an autoloader.

    I did some research and I was really impressed with A.J. Brown's 
dynamic autoloader:

    Rather than assuming a certain convention for how file names relate 
to class names,  it scans directory trees,  parses files and creates a 
mapping.  This adds some overhead,  but that can be reduced by using 
serialize() to cache the result.  I've written some thought about this up:

    Any thoughts?

More information about the talk mailing list