My goal is to write some reusable (OO) code for communicating with an external API, but as I'm not well versed in this kind of stuff in PHP, I'm not sure what is the best way to organize and load my code.
Stuff like limiting the amount of knowledge the client code needs to have about the libraries classes and making sure there are no naming collisions has led me to experiments with namespacing and avoiding having to inlude all the library files have led to experiments with autoloading, but I have so many questions on the subject that in stead of a lengthy process of trial and error, I thought I'd see if I anyone here possessed some wisdom on the subject.
So I guess my main questions are:
- How to best encapsulate the library code, making it stand on it's own as much as possible.
- How to best load/call this library code from the client code.
... but feel free to expand on whatever you think should be considered. :)