11 Purpose
This feature is useful in case of your application is managing diferent sites and you need to load one application file per site. In that situation, you can use multiple DRUID applications with the same library.
First of all, you will have to the only thing you will need is:
- Create one configuration per application needed. For this feature you will need at least 2 configuration files (one per application). You can perform this operation via cockpit panel.
- Paste the first configuration file in the /site-config/default folder. If you previously renamed /site-config folder via /config/druid.ini file, consider the new path.
- Create a folder inside /site-config folder with the name of your application (i.e: /site-config/my-other-app ).
- Paste the second configuration file inside the newly created folder.
Now the way to distinct config files is using the first parameter of the Identity class. If no parameter is passed, the library will be initiated as usual, because you placed your first app file in /site-config/default folder, and if no parameters are passed, this folder is loaded always by default.
1 |
Identity::init(); |
If you need to use the SDK referring your second application, you will have to refer it in the first parameter of Identity::init(); method. You will have to pass the folder name you previously created in the parameter. (in this example my-other-app is the name of the folder we created)
1 |
Identity::init('my-other-app'); |