diff --git a/lib/core/common.py b/lib/core/common.py index f14ebf58b..ebddb7311 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -55,6 +55,7 @@ from lib.core.convert import utf8encode from lib.core.decorators import cachedmethod from lib.core.defaults import defaults from lib.core.dicts import DBMS_DICT +from lib.core.dicts import DEFAULT_DOC_ROOTS from lib.core.dicts import DEPRECATED_OPTIONS from lib.core.dicts import SQL_STATEMENTS from lib.core.enums import ADJUST_TIME_DELAY @@ -599,7 +600,7 @@ def getDocRoot(): docRoot = None pagePath = directoryPath(conf.path) - defaultDocRoot = ("C:/xampp/htdocs/", "C:/Inetpub/wwwroot/") if Backend.isOs(OS.WINDOWS) else ("/var/www/",) + defaultDocRoot = DEFAULT_DOC_ROOTS.get(Backend.getOs(), DEFAULT_DOC_ROOTS[OS.LINUX]) if kb.absFilePaths: for absFilePath in kb.absFilePaths: diff --git a/lib/core/dicts.py b/lib/core/dicts.py index bef9b135b..59a6de59b 100644 --- a/lib/core/dicts.py +++ b/lib/core/dicts.py @@ -6,6 +6,7 @@ See the file 'doc/COPYING' for copying permission """ from lib.core.enums import DBMS +from lib.core.enums import OS from lib.core.enums import POST_HINT from lib.core.settings import BLANK from lib.core.settings import NULL @@ -213,3 +214,8 @@ DUMP_DATA_PREPROCESS = { DBMS.ORACLE: {"XMLTYPE": "(%s).getStringVal()"}, # Reference: https://www.tibcommunity.com/docs/DOC-3643 DBMS.MSSQL: {"IMAGE": "CONVERT(VARBINARY(MAX),%s)"}, } + +DEFAULT_DOC_ROOTS = { + OS.WINDOWS: ("C:/xampp/htdocs/", "C:/Inetpub/wwwroot/"), + OS.LINUX: ("/var/www/",) + }