ePages 7.47.0 - DE_EPAGES/Object/API/Domain.pm

Package DE_EPAGES::Object::API::Domain

Implements concatenation of urls

@EXPORT_OK
Server
ServerSSL
ProtocolAndServer
ProtocolAndServerSSL
Urls
WebServerScriptNameAdmin
WebServerScriptNameAdminSSL
WebServerScriptNameStorefront
WebServerScriptNameStorefrontSSL
WebServerScriptNameMobileStorefront
WebServerScriptNameMobileStorefrontSSL
WebServerScriptNamePreview
WebServerScriptNamePreviewSSL
WebServerScriptNameWithOutExtension
WebServerScriptAdminUrl
WebServerScriptAdminUrlSSL
WebServerScriptStorefrontUrl
WebServerScriptStorefrontUrlSSL
WebServerScriptMobileStorefrontUrl
WebServerScriptMobileStorefrontUrlSSL
WebServerScriptPreviewUrl
WebServerScriptPreviewUrlSSL
GetUrlInfo
PoolDBEntries
TestWebServerScriptNamePart
ConstructUnityDomainName
GetUnitySubDomain

Functions

ConstructUnityDomainName
GetUnitySubDomain
GetUrlInfo
PoolDBEntries
ProtocolAndServer
ProtocolAndServerSSL
Server
ServerSSL
TestWebServerScriptNamePart
Urls
WebServerScriptNameAdmin
WebServerScriptNameAdminSSL
WebServerScriptNameMobileStorefront
WebServerScriptNameMobileStorefrontSSL
WebServerScriptNamePreview
WebServerScriptNamePreviewSSL
WebServerScriptNameStorefront
WebServerScriptNameStorefrontSSL
WebServerScriptNameWithOutExtension
WebServerScriptNameWithOutExtensionSSL

ConstructUnityDomainName

returns the unity domain name

Syntax
$UnityDomain = ConstructUnityDomainName($WebServerScriptNamePart);
Input
$WebServerScriptNamePart (string)
part of webserver script name
Return
$UnityDomain (string)
unity domain name,
# e.g. "test.epages.com"

GetUnitySubDomain

returns the unity sub domain name (lowercase and substítute _ with -)

Syntax
$UnityDomain = GetUnitySubDomain($WebServerScriptNamePart);
Input
$WebServerScriptNamePart (string)
part of webserver script name
Return
$SubDomain (string)
sub domain name

GetUrlInfo

return all informations to build urls of this site. See Urls and PoolDBEntries

Syntax
($hSite, $hSystem) = GetUrlInfo($Site);
Input
$Site (object)
site
Return
$hSite (ref.hash)
site parameter keys :
  • DomainName - domain name - string
  • HasSSLCertificate - can use ssl - boolean
  • WebServerScriptNamePart - script name part - string
  • SiteID - identifier - integer
  • SecondaryDomains - additional domain names - ref.array.string
  • IsUnity - is this a Unity shop (undef: not shop,
    0: no, 1: yes) - boolean
$hSystem (ref.hash)
system parameter keys :
  • DomainName - domain name - string
  • HasSSLCertificate - can use ssl - boolean
  • WebServerScriptNamePart - script name part - string
  • WebServerDirectory - web server directory (epages)- string
  • URLStorefrontExtension - url extension (sf)- string
  • URLMobileStorefrontExtension - url extension (mobile)- string
  • URLAdminExtension - url extension (admin)- string
  • WebServerPort - http port - string
  • SSLWebServerPort - https port - string
  • SiteID - identifier - integer
  • SecondaryDomains - additional domain names - ref.array.string
  • UnityUseSubdomainRouting - subdomain setting set for Unity
    databases (undef: not existing, 0: no, 1: yes)
  • UnityUrlScheme - URL scheme for Unity - string

PoolDBEntries

collects pooldb entries for given site.

Syntax
$aEntries = PoolDBEntries($hSite, $hSystem);
Example
$aEntries = PoolDBEntries(GetUrlInfo($Site));
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$aEntries (ref.array.hash)
keys :
  • Host - host name and port - string
  • URI - url with out host name and extension - string
Hook
PoolDBEntries
hook parameter keys :
  • hEntries - pre collected entries (first key host, second uri) - ref.hash.hash
  • hSite - site info - ref.hash
  • hSystem - system info - ref.hash

ProtocolAndServer

build protocol, http server and port

Syntax
$Server = ProtocolAndServer(($hSite, $hSystem));
Example
$Server = ProtocolAndServer(GetUrlInfo($Site));  # http://www.epages.de:8080
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ProtocolAndServer (string)
protocol, http server and port

ProtocolAndServerSSL

build protocol, https server and port. If the site does not have an SSL certificate and $ENV{'EPAGES_SSL_PROXY'} is set, returns a special SSL proxy URL in the format "http://sslproxy/domainname".

Syntax
$ProtocolAndServerSSL = ProtocolAndServerSSL($hSite, $hSystem);
Example
$Server = ProtocolAndServerSSL(GetUrlInfo($Site));  # https://www.epages.de
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ProtocolAndServerSSL (string)
SSL server name and protocol, e.g.
"https://www.epages.de" or "https://www.epages.de:4443"

Server

build http server and port

Syntax
$Server = Server($hSite, $hSystem, $AddPort);
Example
$Server = Server(GetUrlInfo($Site), 1); # www.epages.de:80 or www.epages.de:8080
$Server = Server(GetUrlInfo($Site), 0); # www.epages.de    or www.epages.de:8080
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
$AddPort (boolean)
add the default port number :80 (default 0)
Return
$Server (string)
server name

ServerSSL

returns the SSL server name. Returns undef if SSL cannot be used. If the site does not have an SSL certificate and the site has a domain and $ENV{'EPAGES_SSL_PROXY'} is set, returns $ENV{'EPAGES_SSL_PROXY'} (which is not necessary a valid server name).

Syntax
$Server = ServerSSL($hSite, $hSystem, $AddPort);
Example
$Server = ServerSSL(GetUrlInfo($Site), 1);  # www.epages.de:443 or www.epages.de:4444
$Server = ServerSSL(GetUrlInfo($Site), 0);  # www.epages.de     or www.epages.de:4444
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
$AddPort (boolean)
add the default port number :443 (default 0)
Return
$Server (string)
SSL server name

TestWebServerScriptNamePart

returns true if web server script name part does not contain illegal characters

Syntax
if ( TestWebServerScriptNamePart($part) ) { ... }
Input
$WebServerScriptNamePart (string)
part of webserver script name
Return
$test (boolean)
true if part OK

Urls

return the effective URLs of this site by merging system and site settings.

Syntax
$hUrls = Urls($hSite, $hSystem);
Example
$hUrls = Urls(GetUrlInfo($Site));
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$hUrls (ref.hash)
system parameter keys :
  • Server - HTTP host (web server name and port, if non-standard),
    example: 'www.myshop.de' or 'www.myshop.de:81' - string
  • ServerSSL - SSL web server name and port if non-standard,
    example: 'www.myshop.de' or 'www.myshop.de:444' - string
  • ProtocolAndServer - protocol and web server name,
    example: 'http://www.myshop.de:81' - string
  • ProtocolAndServerSSL - SSL protocol and web server name,
    example: 'https://www.myshop.de:444' - string
  • WebServerScriptNameWithOutExtension - web server script name without
    extension, but including the dot,
    example: '/epages/myshop.' - string
  • WebServerScriptNameStorefront - web server script name (storefront),
    example: '/epages/myshop.sf' - string
  • WebServerScriptNameStorefrontSSL - web server script name (admin, SSL),
    example: '/epages/Store.sf' - string
  • WebServerScriptNameAdmin - web server script name (storefront),
    example: '/epages/myshop.admin' - string
  • WebServerScriptNameAdminSSL - web server script name (admin, SSL),
    example: '/epages/Store.admin' - string
  • WebServerScriptStorefrontUrl - protocol, web server name and script name (storefront),
    example: 'http://www.myshop.de:81/epages/myshop.sf' - string
  • WebServerScriptStorefrontUrlSSL - web server script name (storefront, SSL),
    example: 'https://www.provider.de/epages/Store.sf' - string
  • WebServerScriptAdminUrl - protocol, web server name and script name (admin),
    example: 'http://www.myshop.de:81/epages/myshop.admin' - string
  • WebServerScriptAdminSSLUrl - protocol, web server name and script name (admin, SSL),
    example: 'http://www.myshop.de:81/epages/myshop.admin' - string
  • WebServerScriptPreviewUrl - protocol, web server name and script name (preview),
    example: 'http://www.myshop.de:81/epages/myshop.preview' - string

WebServerScriptNameAdmin

build url without hostname

Syntax
$ScriptNamePart = WebServerScriptNameAdmin($hSite, $hSystem);
Example
$Server = WebServerScriptNameAdmin(GetUrlInfo($Site));  # /epages/Store.admin
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the back-office URL,
e.g. "/epages/DemoShop.admin"

WebServerScriptNameAdminSSL

build url without hostname, ssl connection preferred.

Syntax
$ScriptNamePart = WebServerScriptNameAdminSSL($hSite, $hSystem);
Example
$Server = WebServerScriptNameAdminSSL(GetUrlInfo($Site));  # /epages/Store.admin
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the back-office URL,
e.g. "/epages/DemoShop.admin"

WebServerScriptNameMobileStorefront

build url without hostname.

Syntax
$ScriptNamePart = WebServerScriptNameMobileStorefront($hSite, $hSystem);
Example
$Server = WebServerScriptNameMobileStorefront(GetUrlInfo($Site));  # /epages/Store.mobile
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the mobile storefront URL,
e.g. "/epages/DemoShop.mobile"

WebServerScriptNameMobileStorefrontSSL

build url without hostname, ssl connection preferred.

Syntax
$ScriptNamePart = WebServerScriptNameMobileStorefrontSSL($hSite, $hSystem);
Example
$Server = WebServerScriptNameMobileStorefrontSSL(GetUrlInfo($Site));  # /epages/Store.mobile
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the mobile storefront URL in SSL mode,
e.g. "/epages/DemoShop.mobile"

WebServerScriptNamePreview

build url without hostname.

Syntax
$ScriptNamePart = WebServerScriptNamePreview($hSite, $hSystem);
Example
$Server = WebServerScriptNamePreview(GetUrlInfo($Site));  # /epages/Store.preview
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the preview URL,
e.g. "/epages/DemoShop.preview"

WebServerScriptNamePreviewSSL

build url without hostname, ssl connection preferred.

Syntax
$ScriptNamePart = WebServerScriptNamePreviewSSL($hSite, $hSystem);
Example
$Server = WebServerScriptNamePreviewSSL(GetUrlInfo($Site));  # /epages/Store.preview
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the preview URL in SSL mode,
e.g. "/epages/DemoShop.preview"

WebServerScriptNameStorefront

build url without hostname.

Syntax
$ScriptNamePart = WebServerScriptNameStorefront($hSite, $hSystem);
Example
$Server = WebServerScriptNameStorefront(GetUrlInfo($Site));  # /epages/Store.sf
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the storefront URL,
e.g. "/epages/DemoShop.sf"

WebServerScriptNameStorefrontSSL

build url without hostname, ssl connection preferred.

Syntax
$ScriptNamePart = WebServerScriptNameStorefrontSSL($hSite, $hSystem);
Example
$Server = WebServerScriptNameStorefrontSSL(GetUrlInfo($Site));  # /epages/Store.sf
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptNamePart (string)
script name part of the storefront URL in SSL mode,
e.g. "/epages/DemoShop.sf"

WebServerScriptNameWithOutExtension

build url without hostname and extension

Syntax
$ScriptName = WebServerScriptNameWithOutExtension($hSite, $hSystem);
Example
$ScriptName = WebServerScriptNameWithOutExtension(GetUrlInfo($Site));  # /epages/Store.
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptName (string)
script name part of the URL without the extension,
e.g. "/epages/DemoShop."

WebServerScriptNameWithOutExtensionSSL

build url without hostname and extension, for ssl connection

Syntax
$ScriptNamePart = WebServerScriptNameWithOutExtensionSSL($hSite, $hSystem);
Example
$Server = WebServerScriptNameWithOutExtension(GetUrlInfo($Site));  # /epages/Store.
Input
$hSite (ref.hash)
site info
$hSystem (ref.hash)
system info
Return
$ScriptName (string)
script name part of the URL without the extension,
e.g. "/epages/DemoShop."