add environment stuff to frontend with fallback to old config.php
Dieser Commit ist enthalten in:
Ursprung
ad6b0f5bb5
Commit
2682a4d1c7
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
// Load environment config file
|
||||
$configEnv = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/data/config/config.environment.php';
|
||||
if (file_exists($configEnv)) {
|
||||
include_once($configEnv);
|
||||
}
|
||||
|
||||
if (!defined('CL_ENVIRONMENT')) {
|
||||
if (getenv('CONLITE_ENVIRONMENT')) {
|
||||
define('CL_ENVIRONMENT', getenv('CONLITE_ENVIRONMENT'));
|
||||
} if (getenv('CONTENIDO_ENVIRONMENT')) {
|
||||
define('CL_ENVIRONMENT', getenv('CONTENIDO_ENVIRONMENT'));
|
||||
} else {
|
||||
define('CL_ENVIRONMENT', 'production');
|
||||
}
|
||||
}
|
||||
|
||||
//echo CL_ENVIRONMENT;
|
|
@ -48,11 +48,32 @@ if (!defined("CON_FRAMEWORK")) {
|
|||
}
|
||||
|
||||
$contenido_path = '';
|
||||
# include the config file of the frontend to init the Client and Language Id
|
||||
include_once ("config.php");
|
||||
|
||||
# Contenido startup process
|
||||
include_once ($contenido_path . 'includes/startup.php');
|
||||
// Set path to current frontend
|
||||
$frontend_path = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/';
|
||||
|
||||
// Include the environment definer file
|
||||
include_once($frontend_path . 'environment.php');
|
||||
|
||||
if (defined('CL_ENVIRONMENT')) {
|
||||
include_once($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.php');
|
||||
|
||||
if (file_exists($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php')) {
|
||||
@include($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php');
|
||||
}
|
||||
} else {
|
||||
if(file_exists($frontend_path.'config.php')) {
|
||||
include_once($frontend_path.'config.php');
|
||||
}
|
||||
if(file_exists($frontend_path.'config.local.php')) {
|
||||
include_once($frontend_path.'config.local.php');
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_file($contenido_path . 'includes/startup.php')) {
|
||||
die("<h1>Fatal Error</h1><br>Couldn't include ConLite startup.");
|
||||
}
|
||||
include_once($contenido_path . 'includes/startup.php');
|
||||
|
||||
cInclude("includes", "functions.con.php");
|
||||
cInclude("includes", "functions.con2.php");
|
||||
|
@ -137,11 +158,9 @@ if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) {
|
|||
// @TODO: Should be outsourced into startup process but requires a better detection (frontend or backend)
|
||||
Contenido_Security::checkFrontendGlobals();
|
||||
|
||||
|
||||
// update urlbuilder set http base path
|
||||
Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);
|
||||
|
||||
|
||||
// Initialize language
|
||||
if (!isset($lang)) {
|
||||
|
||||
|
@ -227,7 +246,6 @@ $aParams = array(
|
|||
);
|
||||
$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
|
||||
|
||||
|
||||
/*
|
||||
* Try to initialize variables $idcat, $idart, $idcatart, $idartlang
|
||||
* Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42
|
||||
|
|
Laden…
In neuem Issue referenzieren