I work on two related web applications, developed in PHP, that started independently. Over time, we have started to more tightly integrate their functionality for business reasons. To accomplish this, we setup a directory for common code in a seperate SVN repository so that we can deploy different versions of this code when we deploy each application separately. A text file in either application repository indicates which revision of the common code should be deployed.
If has worked fairly well so far, but there are some issues and considerations that have arisen:
All of the code that is used by either application in this common interface needs to be 'visible' to both applications. For example, if an item in application #1 is saved through application #2, then all of the supporting code, ORM classes, supporting classes, etc., need to be in the common area.
If application #1 is making method calls to application #2's code, then it is bypassing all of application #2's startup code - authentication, framework, etc. This could lead to un-desirable results and unexpected dependencies.
At this point, we prefer to keep the applications separate.
What would be considered the best way for these two applications to communicate with each other? We could use an http communication that ensures a reliable interface and that each application is handling processes through it's own application processes. We worry about incurring overhead from http, but the trade-off of a more loosely coupled system would probably surpass that concern.
At this time, both applications are running on the same set of servers, and, as mentioned, using PHP almost exclusively.
EDIT: The communication will be private and authenticated within the apps, meaning no plans for public API.