From 457e348266100a8d43720b614e898552d1fe24e5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Sep 2017 16:49:18 +0200 Subject: [PATCH] config/config_path.php => inc/downstream.php ensure local_define is loaded before downstream.php --- inc/api.class.php | 6 ++++-- inc/based_config.php | 11 +++++++++-- inc/define.php | 4 ---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/inc/api.class.php b/inc/api.class.php index 3ae2966ce1..85eea1d74e 100644 --- a/inc/api.class.php +++ b/inc/api.class.php @@ -247,8 +247,10 @@ protected function retrieveSession() { $current = session_id(); $session = trim($this->parameters['session_token']); - if (file_exists(GLPI_ROOT . "/config/config_path.php")) { - include_once (GLPI_ROOT . "/config/config_path.php"); + if (file_exists(GLPI_ROOT . '/inc/downstream.php')) { + include_once (GLPI_ROOT . '/inc/downstream.php'); + } else if (file_exists(GLPI_ROOT . '/config/config_path.php')) { // For compatibility, deprecated + include_once (GLPI_ROOT . '/config/config_path.php'); } if (!defined("GLPI_SESSION_DIR")) { define("GLPI_SESSION_DIR", GLPI_ROOT . "/files/_sessions"); diff --git a/inc/based_config.php b/inc/based_config.php index ac6dacb893..d952712f77 100644 --- a/inc/based_config.php +++ b/inc/based_config.php @@ -46,9 +46,16 @@ date_default_timezone_set(@date_default_timezone_get()); } +// If this file exists, it is load +if (file_exists(GLPI_ROOT. '/config/local_define.php')) { + require_once GLPI_ROOT. '/config/local_define.php'; +} + // If this file exists, it is load, allow to set configdir/dumpdir elsewhere -if (file_exists(GLPI_ROOT ."/config/config_path.php")) { - include_once(GLPI_ROOT ."/config/config_path.php"); +if (file_exists(GLPI_ROOT . '/inc/downstream.php')) { + include_once (GLPI_ROOT . '/inc/downstream.php'); +} else if (file_exists(GLPI_ROOT . '/config/config_path.php')) { // For compatibility, deprecated + include_once (GLPI_ROOT . '/config/config_path.php'); } // Default location for database configuration : config_db.php diff --git a/inc/define.php b/inc/define.php index b66e00cfdb..4df3619015 100644 --- a/inc/define.php +++ b/inc/define.php @@ -34,10 +34,6 @@ * @brief */ -if (file_exists(GLPI_CONFIG_DIR . '/local_define.php')) { - require_once GLPI_CONFIG_DIR . '/local_define.php'; -} - // Current version of GLPI define('GLPI_VERSION', '9.2'); if (substr(GLPI_VERSION, -4) === '-dev') {