tommcfarlin/simple-autoloader-for-wordpress

Missing file_exists() check

Opened this issue · 3 comments

https://tommcfarlin.com/namespaces-and-autoloading-2017/ actually says,

Note that this code is not checking to see if the file exists. Though I recommend it, it’s been left out for the sake of length and because, in our example, we know the file does exist.

:)

I didn't submit a PR because your article says there are a few options for what to do if it doesn't exist and I didn't want to waste time writing one if you preferred another.

file_exists is normally the check I use.

I'm unclear... is file_exists() omitted from autoload.php intentionally or should it be added?

It can be added. The repository doesn't have it included because this particular code was used during a presentation in which we knew the code would exist.

If you want to open a PR to include the check, that's fine!