Background description: There are two applications developed by Php+mysql A and application B, and two applications on a single server. Both A and B can be accessed externally. A responsible for user account management, creation, activation, deletion and so on. b Responsible for specific business, orders and so on.
Problem: B application needs to create an account to avoid duplication of functionality, B application wants to directly call a to create the user interface. So how does a application implement this interface, while hiding the interface from being invisible, allowing only internal application calls
Reply content:
Background description: There are two applications developed by Php+mysql A and application B, and two applications on a single server. Both A and B can be accessed externally. A responsible for user account management, creation, activation, deletion and so on. b Responsible for specific business, orders and so on.
Problem: B application needs to create an account to avoid duplication of functionality, B application wants to directly call a to create the user interface. So how does a application implement this interface, while hiding the interface from being invisible, allowing only internal application calls
It can be simply understood that the implementation of program A provides some API interfaces (methods) that can be called by program B.
There is a concept of RPC (remote procedure Call) you should be interested to take a look at this: an analysis of remote procedure call RPC.
Of course, after reading, you think you can, then use the Web Service to achieve your needs well. Just recently summed up a few articles, and today there is just another article about the use of the PHP SOAP extension, which shows how to implement a basic Web Service.
However, now the most popular style of RESTful API, it may be considered.
A add an interface to create an account, a in the only place where this interface with the IP restrictions, B in accordance with the normal method of invoking this excuse
Require header file
That's what WebService did.
Define requests, call requests in other modules