This topic is locked

Guide 40 – Install PHPRunner development on multiple instances with customization

7/11/2022 7:11:39 PM
PHPRunner Tips and Tricks
fhumanes author

Many of the consult I have had were as a result of how to develop an application in PHPRunner and install it for various Offices or Companies.
In these situations, you usually ask yourself:

  • Is a single database instance used for all companies?
  • How is the application customized so that it has identification (logo, company name, etc.) for each company?

There are many more questions, but these are often the "big" and difficult to answer.

Normally I indicate that if they are data from a single company , but the analysis of them is by department, warehouse or something similar, a single database is used and in all the tables the department, warehouse, etc., is indicated, to manage authorizations according to that division of information.
I have an example that uses this system, it is the Multiple Workflows application , where the selection key is the “ Id ” of the management process.

Now, if the same application is for unrelated companies and the information is never going to be analyzed by joining the data of these, the most interesting thing is that they are different instances of the database and also of applications (in order to personalize each business). And in this case, how do we manage the project in PHPRunner?

  • Do we have different project versions for each of the instances?
    This means that the evolution of the product is going to be different and therefore the management of changes and evolution is going to be much more complex.


  • Do we have a single version of the project for all instances/companies?
    This means generating differentiated versions of the application with customizations for each of the instances/companies. How could this be managed?



Goal

Design an alternative to have a single PHPRunner project and install it for several companies, customizing the instance according to the characteristics of the company to which it is going to offer service.

Technical Solution

Really, I am not inventing anything, what you want to obtain is what is usually available for any PHP development, that is, that the application is customized through a configuration file.

In this file, in addition to the connection data to the database, you must also have customization of the characteristics that are different between the companies that use the application.

To address these requirements in the PHPRunner solution, I have defined:

  1. Create a file " config.php " to establish the connection data to the database.
  2. In the same “ config.php ” file , set the personalization values ​​(differences) of the values ​​between the companies in session variables.
  3. Isolate the identifications of the users of the different instances (necessary to use the same session cookie for all the instances of the application)
  4. Due to PHPRunner architecture, there are customizations that are only in HTML (for example, application logo), we want to change it without having to generate the product several times. For this, a JavaScript “ csi.js ” will be used, which will allow us to customize this type of information without having to generate it from PHPRunner.

If you are interested in this article, keep reading the solution proposal through this link.