When you have a PHP application with a large number of classes, dependencies and files, can be very painful to create several
include() methods in order to load all classes upon every request. This practice can lead to several errors, besides making your application have a poor performance, since every single file will be loaded even if the current request is not using it. That's where autoloaders come in.
An autoloader will load automatically in runtime only those files that are being currently used. It will also increase your application performance by having predefined paths in where to look for files, and have a nice way to organize your application dependencies.
Glowie has several predefined namespaces that will be processed by the autoloader. Namespaces are, by default, routed to the following folders:
Glowie\Commandsnamespace is stored into
Glowie\Controllersnamespace is stored into
Glowie\Middlewaresnamespace is stored into
Glowie\Migrationsnamespace is stored into
Glowie\Modelsnamespace is stored into
Glowie\Helpersnamespace is stored into
When autoloading classes, remember that class names and their namespaces must match the exact directory and filenames.