Posts marked with “autoload”
Education Station: Autoloading Your Code
Broadly speaking, autoloading is a mechanism for the loading code into your program on demand. If you look at a single request in your application, chances are it needs a different set of classes than another request. Where a “Login” action may use a controller, database class, and an authentication layer, a “Logout” action may […]
Generating an Autoloader for a Legacy PHP Codebase
If you’ve inherited a legacy code base, you may find it does not use an autoloader and has an idiosyncratic directory and file hierarchy for its Classes, Interfaces or Traits. Worse yet, it might not use name spaces consistently or at all. So you can’t use a PSR-4—or even PSR-0—autoloader with your code. Well, why […]