Posts marked with “autoload”

Education Station: Autoloading Your Code

by · September 1, 2020

0
 

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

by · September 6, 2017

1
 

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 […]