Reputation:
I have a site which uses the library file lib.client.php
which is stored in the php
folder in my standard website root and contains a series of classes I have built.
I am going to have to require_once
this library file in almost every single page, what is the best way I can implement this? Furthermore, should I be using some conbination of functions using __autoload
to accomplish this?
Having seen a very similar question which touches on the issue but offers a very specific answer I can't really use, and looking a bit into the __autoload
function, I want to get a more detailed answer for my requirements.
Upvotes: 0
Views: 47
Reputation: 12505
You use __autoload (or better: spl_autoload_register; or even better: some autoloader written by someone else) if:
In your case: just use require_once (or refactor, but I would not bother).
Upvotes: 1