This is something of a follow-up on this topic, but is sufficiently different to require a new thread! As I have explained before, my app links together different web-based messaging systems (email, bulletin boards, blogs, RSS, etc) under a single interface.
I'd like it to be as flexible, modular and as useful as possible. A big part of it will be interfacing with 3rd-party code (for example, phpBB). One conundrum I've come across is collisions between function and class names in this code. For example, in order to mirror posts from a phpBB2 forum to a phpBB3 forum (yes, some people want to!), I'd normally have to include code from both packages into the scope of my application. My app, sitting on the user's server, would be triggered by a post in a phpBB2 forum (the phpBB2 functions are therefore defined in the global namespace), but would later need to include() the phpBB3 files in order to make the post. This is asking for trouble - there are many repeated function names between the two packages.
I have a working solution, but I'm not happy with it for a number of reasons. It parses the 3rd-party files I need, changes all function and class names to unique strings for that package instance, performs other substitutions such as global variables, and stores the parsed files in a cache to be included when needed. The problems with this theory:
- It's very hard to make my parsed files bug-free, and developing the parser for each 3rd-party app takes ages
- This is only a solution for apps on the same server as my app, which substantially limits the usefulness
Having never done this kind of thing before, I'd like to ask for advice on the best approach. Don't worry about the formatting of the message - all that is taken care of. Instead, the issues I can think of are speed and security. Obviously the speed depends on internet connection quality, but I'd like advice on the fastest transport mechanism available in PHP, bearing in mind the message contents may possibly include attachments. Security is the big one - if I'm distributing an app which encourages a user to place a file on their server that enables a phpBB forum post to be made from a foreign server, I need to be absolutely certain that the connection between the two servers is secure and private.
So, I'd like some advice on the best transport option (including ideas for how best to compress the message) and the security for the connection, including authentication, hashing, salting, encryption, challenge-response, etc. (I'm a bit of a novice with securitiy considerations). Although I have required PHP 5.2 for my app, I'd like to avoid non-standard PHP modules and extensions where possible in order to cater for a wide community of users (the instance of my app will be hosted by the user, rather than by me).
I'm by no means looking for code; more a bullet-list of things to consider, and links to forum discussions and/or tutorials where I might do some research. Many thanks for your help!
EDIT: API is the word I've been looking for. Any links to good tutorials on the subject?