summaryrefslogtreecommitdiffstats
path: root/457e348266100a8d43720b614e898552d1fe24e5.patch
blob: b9435e071d1866a380189c05b2a1d86576392dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From 457e348266100a8d43720b614e898552d1fe24e5 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
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') {