Applications
TraceWatch consists of 4 applications:
- Base Application
- In twatch/base folder. This provides common functionality to all other applications.
- TraceWatch Application
- In twatch folder. This is TraceWatch itself.
- IP-to-Country Application
- In twatch/country folder. TraceWatch application uses this through the country plugin. This is going to have more independent features in future.
- User Manager Application
- In twatch/user folder. This is not complete yet and is currently a shadow of what it's going to be. both twatch and country apps require this for their user management needs.
As you can see there are some dependencies but each of these apps are structurally and conceptually independent you can move them around, install them on a different database, etc...
Profiles
Each application may have multiple profiles. Adding a profile to an application is like making a complete duplicate of that application without duplicating the files and accessing/controlling both from the same interface.
Profiles are in the folder profiles of each application. Each profile has it's own settings file, plugins, etc...
To make a new profile for TraceWatch application duplicate twatch/profiles/default folder and give it a unique name like twatch/profiles/new_profile now you should be able to see a new drop-down list on top of TraceWatch pages for selecting the profile and you can customize the settings.php of the new profile to use a different database, table name prefix, etc... You can also use the $settings[ 'profile_name' ] setting in each profile to set the name that shows in the drop-down list.
You can make different profiles for other applications too and make certain profile of tracewatch to use a certain profile of that other application through settings.php file.
[IMPORTANT] You don't need to make a new base profile just to let a certain app use a different database than others. See the note about the base settings file below for more information.
Setting Files
Each profile of each application have a settings file named settings.php which lets you configure that application.
There is something special and important about the settings.php file of the base application and that is all other applications inherit setting values of the base application. That's why you don't need to enter database server and database name for each app and just enter them in the base settings file. However you can override any of those settings in a certain app by adding that setting value to the settings.php file of that app. For example suppose you have $settings[ 'db_database' ] = 'my_database'; in the base settings.php file. you can add $settings[ 'db_database' ] = 'my_other_database'; line to the settings.php file of the country application so that it uses your other database. You can do this with any other setting value in the base app.

