From a74e67cf53205df3476144a344e795dbd685021a Mon Sep 17 00:00:00 2001
From: Laurent Giovannoni <laurent.giovannoni@maarch.org>
Date: Tue, 18 Oct 2011 13:57:41 +0000
Subject: [PATCH] pb with include path with custom

---
 core/trunk/ws_server.php | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/core/trunk/ws_server.php b/core/trunk/ws_server.php
index 7162f8c44cc..76dc1db2bdd 100755
--- a/core/trunk/ws_server.php
+++ b/core/trunk/ws_server.php
@@ -43,6 +43,25 @@ $portal->unset_session();
 $portal->build_config();
 $coreTools = new core_tools();
 $_SESSION["custom_override_id"] = $coreTools->get_custom_id();
+if (isset($_SESSION['custom_override_id'])
+    && ! empty($_SESSION['custom_override_id'])
+    && isset($_SESSION['config']['corepath'])
+    && ! empty($_SESSION['config']['corepath'])
+) {
+    $path = $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
+        . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR;
+    //echo $path;
+    set_include_path(
+        $path . PATH_SEPARATOR . $_SESSION['config']['corepath']
+        . PATH_SEPARATOR . get_include_path()
+    );
+} else if (isset($_SESSION['config']['corepath'])
+	&& ! empty($_SESSION['config']['corepath'])
+) {
+    set_include_path(
+        $_SESSION['config']['corepath'] . PATH_SEPARATOR . get_include_path()
+    );
+}
 $coreTools->build_core_config("core".DIRECTORY_SEPARATOR."xml".DIRECTORY_SEPARATOR."config.xml");
 $_SESSION["config"]["app_id"] = $_SESSION["businessapps"][0]["appid"];
 require_once("apps".DIRECTORY_SEPARATOR.$_SESSION["businessapps"][0]["appid"].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_business_app_tools.php");
-- 
GitLab