From 2508f64efee5204fdb38eda51435d0bad7da76f2 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sat, 1 Sep 2012 20:51:48 +0200
Subject: [PATCH] set debug mode if an xdebug session is active

---
 lib/base.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/base.php b/lib/base.php
index bfefa1425a..1875edb500 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -315,6 +315,13 @@ class OC{
 
 		self::initPaths();
 
+		// set debug mode if an xdebug session is active
+		if (!defined('DEBUG') || !DEBUG){
+			if(isset($_COOKIE['XDEBUG_SESSION'])){
+				define('DEBUG',true);
+			}
+		}
+
 		// register the stream wrappers
 		require_once('streamwrappers.php');
 		stream_wrapper_register("fakedir", "OC_FakeDirStream");
-- 
GitLab