PHP Designing Interfaces in PHP Introducing Interfaces Autoloading

Eliyah Kohein
Eliyah Kohein
19,268 Points

Question about autoloader function

I was curious as to why we used

__DIR__ . '/*'

instead of

__DIR__ . '/classes'

since we were only looking for classes anyway.

Brandyn Lordi
Brandyn Lordi
15,543 Points

So we can check every file inside every folder. If we want to use a different file down the road that might not be inside the classes folder, this function will still work.

The function is looping through each directory that's inside the current directory- in search of matching files.