# Installation

Since Version 0.3.x the Text-DB-Api Zip also includes the WebGUI and a
Table Editor. To use the Text-DB-API its still sufficient to upload only the
8 main .php Files (resultset.php, database.php, etc...) and to configure the
txt-db-api.php File.
This form of installation is described below in the paragraph "Manual Installation".
Since the 0.3.x Verions you can also install and configure the API and the included
GUI's with a Wizard (installer.php). The installer.php script must be downloaded separately
from the Sourceforge Page.
To install the API this way, you have to upload the Text-DB-API Zip and the installer.php
file into the SAME directory on the webserver. Then you only have to call the isntaller.php
script and the Wizard will guide you through the installation.

# Manual Installation

## Upload the files:

All PHP Files ot the Txt-Db-Api must be uploaded in one directory.

## Change the File txt-db-api.php

Before uploading all the .php files the file txt-db-api.php must be changed.
You have to set the two Vars $API_HOME_DIR and $DB_DIR to correct values.

$API_HOME_DIR:
This variable must be set to the absolute or relative path where all the Txt-Db-Api Files are located.
For example: /home/c-worker.ch/public_html/php-api/

$DB_DIR:
This variable must be set to the absolute or relative path where the database folders are.
For example if you have a database folder at /home/c-worker.ch/dbs/TestDB, set
$DB_DIR to /home/c-worker.ch/dbs/. Now you can have 1 or more folders in the
/home/c-worker.ch/dbs/ folder, each representing a singe database.

The file txt-db-api.php doesn't change in new versions. Don't overwritte it when you
install a new version. Just keep the old file! If this file will change, i'll put a big notice
in the changelog!

## Absolute or relative Paths for API_HOME_DIR and DB_DIR

You can set the $API_HOME_DIR and $DB_DIR vars to either relative (relative to the file which
includes txt-db-api.php) or absolute (relative to the server root) paths.

If you use absolute paths, you only need one txt-db-api.php file.
This file should be placed by the other files of the Text-Db-Api (where it is by default
when the zip file is extracted).

If you use relative Paths, I REALLY RECOMMEND to let each project have its own
txt-db-api.php file. This file should be placed in the Folder of the corresponding project.
This is neccessary because differrent projects may have another relative Path to the
API and Database Directory. So each project will now include its own txt-db-api.php
File located in its folder.
In the API Folder you now, no longer need a txt-db-api.php file, sience each project has its own.

If you want, you can also let each project have its own txt-db-api.php file when using
absolute paths. This might be usefull if you want to use different Database-Roots for
each Project.