X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fwrapper-functions.php;h=4ac0eeeffbab122a10d0e04f347e76181aa18d23;hb=e19231f39d9d6583cc5753dbd2638c597957fdd1;hp=4520489da1ffc09a355846e58f2018a46c3034ad;hpb=09c638dfc27f9d7fe4add01d672801498e91cca3;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 4520489da1..4ac0eeeffb 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -11,7 +11,7 @@ * Kurzbeschreibung : Wrapper-Funktionen * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2015 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -293,6 +293,24 @@ function detectServerName () { return (getenv('SERVER_NAME')); } +// Detects server protocol (http/s) +function detectServerProtocol () { + // Is cache there? + if (!isset($GLOBALS[__FUNCTION__])) { + // Default is HTTP + $GLOBALS[__FUNCTION__] = 'http'; + + // Are some specific fields set? + if (((isset($_SERVER['HTTPS'])) && (strtolower($_SERVER['HTTPS']) == 'on')) || ((isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'))) { + // Switch to HTTPS + $GLOBALS[__FUNCTION__] = 'https'; + } // END - if + } // END - if + + // Return cached value + return $GLOBALS[__FUNCTION__]; +} + // Removes any existing www. from SERVER_NAME. This is very silly but enough // for our purpose here. function detectDomainName () { @@ -3588,5 +3606,23 @@ function setSessionCompiled ($key, $value) { return setSession($key, $value); } +// Does normal bootstrap +function doNormalBootstrap () { + // Load configuration file(s) here + loadIncludeOnce('inc/load_config.php'); + + // Load database layer here + loadIncludeOnce('inc/db/lib.php'); + + // Init message system + initMessages(); + + // CSS array + initExtensionCssFiles(); + + // Initialize SQL link + initSqlLink(); +} + // [EOF] ?>