<Database>

The <Database> option is used to configure Gigatrees for use with web servers. It will require that your web server supports PHP, SQLite3 and PDO extensions. This is standard for Apache servers and generally enabled by default. Consult your hosting service for help if needed. Gigatrees includes several support files in the includes folder ( /includes ) to support using databases. When enabled, all the necessary files will be copied to the output path. These files include the main router ( router.php ), which retrieves the requested web page from the database, sends it to the web browser, and manages user authentication when enabled; the Apache Web Server access file ( .htaccess ), which redirects all incoming page requests to the main router and blocks direct page requests to common database file extensions; the database access file ( pdodriver.php ), which gives the router to access the database; and the includes file ( includes.php ), which is autogenerated by Gigatrees and tells the router where the database is located on the server.

Example

<Database>
  <EnableServerDatabase> true                      </EnableServerDatabase>
  <ServerDatabaseName>   database.sqlite           </ServerDatabaseName>  
  <ServerDatabasePath>   /home/site/dbs/           </ServerDatabasePath>  
  <LocalDatabasePath>    web                       </LocalDatabasePath>   
  <CopySupportFiles>     true                      </CopySupportFiles>    
  <SupportFilesPath>     includes                  </SupportFilesPath>
  <ZlibCompression>      true                      </ZlibCompression>    
  <VisitorLogPath>       /home/site/logs/site.log  </VisitorLogPath>   
  <SigninRequired>       true                      </SigninRequired>    
  <User>
    <Username>           guest                     </Username>    
    <AccessCode>         guest                     </AccessCode>    
  </User>  
  <User>
    <Username>           guest2                    </Username>    
    <AccessCode>         guest2                    </AccessCode>    
  </User>  
</Database>

Options

<EnableServerDatabase>
[ false ]
To enable this service, this option must be set to true.
<ServerDatabaseName>
[ ]
Expects a database filename only. A file extension is optional.
<ServerDatabasePath>
[ ]
Expects a relative web server folder. This is the database path on the web server and will be saved in the includes file. As a general rule, web server databases should not be stored in any folder exposed to the Internet. If you are unable to move your database off of the server, you should use one of the extensions already being blocked by the web server access file ( .db, .sql, .sqlite ).
<LocalDatabasePath>
[ ]
Expects an absolute or relative folder path. This is the path found on the local computer where you want your database stored. This is necessary for the application to find and use when building your website.
<CopySupportFiles>
[ true ]
To use this service, Gigatrees requires the support files mentioned above. Once they are copied to the server, it is not necessary to copy them repeatedly. If you need to modify any of these files, for instance to extend their capabilities, you may want to disable this option by setting it to false.
<SupportFilesPath>
[ includes]
Expects an absolute or relative folder path. This is the path found on the local computer where your database support files are stored. This is necessary for the application to find and use when building your website.
<ZlibCompression>
[ false ]
When enabled, Gigatrees will use the ZLib 1.2.11 compression library to store the HTML content into the database. In practice this can reduce the total size of the database by a factor of 6x. This may be necessary of your hosting service limits the size of individual files. Decompression and checksum validation are handled automatically by the router, so it should be seemless both to website creators and visitors.
<VisitorLogPath>
[ ]
Expects a relative web server folder. When set, all page accesses will be logged to this file.
<SigninRequired>
[ false ]
When enabled, all pages require user authentication to access. When disabled, individual blog posts can be locked as well.
<User>
[ ]
This tag indicates the start of a new user.
<Username>
[ ]
The visitor's username.
<AccessCode>
[ ]
The visitor's access code. Gigatrees does not use encryption when storing, retrieving or comparing this value, so passwords should not be used.
Comments