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

Package DE_EPAGES::Database::API::Config

This module contains access function to read Database.d/$Store.conf.

@EXPORT_OK
StoreConnections
StoreType
StoreTypes
DatabaseConfig
DatabaseConfigFileName
DatabaseConnectionData
DatabaseRedirect

Functions

DatabaseConfig
DatabaseConfigFileName
DatabaseConnectionData
DatabaseRedirect
StoreConnections
StoreType

DatabaseConfig

get ini object of the Database.d/$Store.conf

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

DatabaseConfigFileName

get full file name of the Database.d/$Store.conf

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

DatabaseConnectionData

Gets database info from Database.d/$Store.conf. Throws an error if the section does not exists. Passwords are decrypted transparently.

Syntax
$hSection = DatabaseConnectionData($Store);
Example
$hSection = DatabaseConnectionData('Store');
Return
$Store (string)
logical database name
$hSection (ref.hash.string)
connection info keys:
  • datasource - dbd connection string - string
  • login - database login name - string
  • passwd - database password (not encrypted)- string

DatabaseRedirect

Get database redirect file from Database.d/$Store.conf, section $Store, 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($Store);
$FileName = DatabaseRedirect($Store, $ConnectionName, $RemoteAddr);
Input
$Store (string)
logical database name
$ConnectionName (string)
unused | string
§RemoteAddr $RemoteAddr | (optional) comma-separated list of IP addresses for which
access is granted anyway
Return
$FileName (string)
file name (relative to $EPAGES_WEBROOT), undef if
no redirect is required

StoreConnections

get all connections that have config file Database.d/$Store.conf

Syntax
$aStoreConnections = StoreConnections();
Return
$aStoreConnections (ref.array)
list of basenames from Database.d

StoreType

Returns the store type of a store

Syntax
$StoreType = StoreType( $Store );
Return
$Store (string)
logical database name
$StoreType (ref.array)
list of basenames from Database.d