ePages 6.10 - DE_EPAGES/Database/API/Config.pm

Package DE_EPAGES::Database::API::Config

This module contains access function to read the Database.conf .

@EXPORT_OK
DatabaseConfig
DatabaseConfigFileName
DatabaseConnectionData
DatabaseRedirect

Functions

DatabaseConfig
DatabaseConfigFileName
DatabaseConnectionData
DatabaseRedirect

DatabaseConfig

get ini object of the Database.conf

Syntax
$IniConfig = DatabaseConfig();
Return
$IniConfig (object)
config object

DatabaseConfigFileName

get full file name of the Database.conf

Syntax
$ConfigFileName= DatabaseConfigFileName();
Return
$ConfigFileName (string)
file name

DatabaseConnectionData

Gets database info from Database.conf. Error if section not exists or database not active. Passwords are decrypted transparently.

Syntax
$hSection = DatabaseConnectionData($Site, $ConnectionName);
Return
$Site (string)
logical database name
$ConnectionName (string)
connect name (default: Default)
$hSection (ref.hash.string)
connection info keys:
  • datasource - dbd connection string - string
  • login - database login name - string
  • passwd - database password (not crypted or crypted)- string

DatabaseRedirect

Get database redirect file from Database.conf, section $Site key "redirect", except if $RemoteAddr matches the list of exceptions specified by key "AllowFrom". If $FileName is defined, the content of the file "$ENV{'EPAGES_WEBROOT'}/$FileName" shall be returned the client and no database connection shall be opened.

Syntax
$FileName = DatabaseRedirect($Site, $ConnectionName, $RemoteAddr);
Return
$Site (string)
logical database name
$ConnectionName (string)
connect name (default: Default)
$FileName (string)
file name (relative to $EPAGES_WEBROOT), undef if
no redirect is required