From 470b2d1b6189542bccbf3137c301974fa061054d Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Mon, 11 Nov 2024 17:52:50 +0100 Subject: [PATCH 1/4] improve description of getTickCount function --- core/src/main/java/resource/fld/core-base.fld | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/resource/fld/core-base.fld b/core/src/main/java/resource/fld/core-base.fld index 9e05bb908b..a91c989da0 100755 --- a/core/src/main/java/resource/fld/core-base.fld +++ b/core/src/main/java/resource/fld/core-base.fld @@ -6990,16 +6990,23 @@ Use the GetBaseTemplatePath() function instead. getTickCount lucee.runtime.functions.other.GetTickCount lucee.transformer.cfml.evaluator.func.impl.GetTickCount - Returns the number of milliseconds since the start of the application server + + Returns the elapsed time from a specific reference point, based on the specified `unit`. + The default unit, "milli," represents milliseconds since midnight, January 1, 1970 UTC, and aligns with conventional system time. + The "nano" and "micro" units offer high-resolution timing based on the Java Virtual Machine's internal clock, ideal for measuring elapsed time rather than absolute wall-clock time. + These values are not tied to real-world dates but provide a consistent point of origin within the Java Virtual Machine for accurate time intervals. + This function is well-suited for performance testing, such as timing code execution, by capturing precise intervals. unit string No - base unit for the function, valid values are: -- nano: nano seconds -- milli (default): milli seconds -- second: seconds - + Specifies the unit of time for the returned value. Valid options include: +- **nano**: nanoseconds, representing elapsed time from an arbitrary fixed origin, with high precision for timing purposes. +- **micro**: microseconds, derived from nanoseconds (dividing by 1,000), also measuring elapsed time with high precision. +- **milli** (default): milliseconds, representing the difference between the current time and midnight, January 1, 1970 UTC. +- **second**: seconds, representing elapsed time from the same reference point as milliseconds. + + number From 83cea73bddbe7660138a38dc7f58497210064661 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Mon, 11 Nov 2024 18:24:31 +0100 Subject: [PATCH 2/4] release --- loader/build.xml | 2 +- loader/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/build.xml b/loader/build.xml index 03f4a619ae..b692855b4d 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 83f3aa7308..efe13b2de5 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.1.118-SNAPSHOT + 6.1.1.118 jar Lucee Loader Build From aa9cb97c193ae230c5ff14d055a94051fb7ca90d Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Thu, 21 Nov 2024 09:58:30 +0100 Subject: [PATCH 3/4] convert xml to json: cacheClasses as array not as struct --- .../main/java/lucee/runtime/config/ConfigFactory.java | 9 +++++---- loader/build.xml | 2 +- loader/pom.xml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/lucee/runtime/config/ConfigFactory.java b/core/src/main/java/lucee/runtime/config/ConfigFactory.java index f2217cef4c..8334452cda 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigFactory.java @@ -316,12 +316,13 @@ else if (old instanceof InputSource) { //////////////////// caches //////////////////// { - Struct cache = ConfigWebUtil.getAsStruct("cache", root); Struct caches = ConfigWebUtil.getAsStruct("caches", root); - Array conns = ConfigWebUtil.getAsArray("connection", cache); + Array acache = ConfigWebUtil.getAsArray("cache", caches); + + add(acache, "cacheClasses", root); - // classes - move("cache", "cacheClasses", caches, root); + Struct cache = ConfigWebUtil.getAsStruct("cache", root); + Array conns = ConfigWebUtil.getAsArray("connection", cache); // defaults for (String type: ConfigPro.STRING_CACHE_TYPES_MAX) { diff --git a/loader/build.xml b/loader/build.xml index b692855b4d..9f844c84d9 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index efe13b2de5..fe5c37f53c 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.1.118 + 6.1.2.0-SNAPSHOT jar Lucee Loader Build From aee2e461e44e7b3e737aaaf2e5628d5141915162 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Thu, 21 Nov 2024 11:05:42 +0100 Subject: [PATCH 4/4] LDEV-5166 - add missing mappings --- .../lucee/runtime/config/ConfigFactory.java | 59 ++++++++++++++++++- .../runtime/config/ConfigWebFactory.java | 20 +++++++ loader/build.xml | 2 +- loader/pom.xml | 2 +- 4 files changed, 79 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/lucee/runtime/config/ConfigFactory.java b/core/src/main/java/lucee/runtime/config/ConfigFactory.java index 8334452cda..7d83706b31 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigFactory.java @@ -399,8 +399,35 @@ else if (old instanceof InputSource) { moveAsBool("useShadow", "componentUseVariablesScope", component, root); // mappings - Array ctMappings = ConfigWebUtil.getAsArray("mapping", component); - add(ctMappings, "componentMappings", root); + Array comMappings = ConfigWebUtil.getAsArray("mapping", component); + add(comMappings, "componentMappings", root); + + // remove and add default mappings + Array arr = Caster.toArray(root.get("componentMappings", null), null); + Struct sct = null; + String v; + boolean hasDefault = false; + if (arr != null && arr.size() > 0) { + arr.size(); + for (int i = arr.size(); i > 0; i--) { + sct = Caster.toStruct(arr.get(i, null), null); + if (sct != null) { + v = Caster.toString(sct.get("physical", null), null); + if ("{lucee-web}/components/".equals(v) || "{lucee-server}/components/".equals(v)) arr.removeEL(i); + else if ("{lucee-config}/components/".equals(v)) hasDefault = true; + } + } + } + if (!hasDefault) { + sct = new StructImpl(); + sct.setEL("inspectTemplate", "never"); + sct.setEL("physical", "{lucee-config}/components/"); + try { + arr.insert(1, sct); + } + catch (PageException e) { + } + } rem("mapping", component); } @@ -417,6 +444,34 @@ else if (old instanceof InputSource) { move("customTagExtensions", "customTagExtensions", ct, root); Array ctMappings = ConfigWebUtil.getAsArray("mapping", ct); add(ctMappings, "customTagMappings", root); + + // remove and add default mappings + Array arr = Caster.toArray(root.get("customTagMappings", null), null); + Struct sct = null; + String v; + boolean hasDefault = false; + if (arr != null && arr.size() > 0) { + arr.size(); + for (int i = arr.size(); i > 0; i--) { + sct = Caster.toStruct(arr.get(i, null), null); + if (sct != null) { + v = Caster.toString(sct.get("physical", null), null); + if ("{lucee-web}/customtags/".equals(v) || "{lucee-server}/customtags/".equals(v)) arr.removeEL(i); + else if ("{lucee-config}/customtags/".equals(v)) hasDefault = true; + } + } + } + if (!hasDefault) { + sct = new StructImpl(); + sct.setEL("inspectTemplate", "never"); + sct.setEL("physical", "{lucee-config}/customtags/"); + try { + arr.insert(1, sct); + } + catch (PageException e) { + } + } + rem("mapping", ct); } diff --git a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java index 418d08906f..7034513875 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java @@ -2914,6 +2914,7 @@ else if (hasCS) { boolean hasSet = false; Mapping[] mappings = null; if (hasAccess) { + boolean hasDefault = false; if (ctMappings.size() > 0) { Iterator it = ctMappings.valueIterator(); List list = new ArrayList<>(); @@ -2928,6 +2929,9 @@ else if (hasCS) { String archive = getAttr(ctMapping, "archive"); boolean readonly = toBoolean(getAttr(ctMapping, "readonly"), false); boolean hidden = toBoolean(getAttr(ctMapping, "hidden"), false); + if ("{lucee-web}/customtags/".equals(physical) || "{lucee-server}/customtags/".equals(physical)) continue; + if ("{lucee-config}/customtags/".equals(physical)) hasDefault = true; + short inspTemp = inspectTemplate(ctMapping); int insTempSlow = Caster.toIntValue(getAttr(ctMapping, "inspectTemplateIntervalSlow"), -1); int insTempFast = Caster.toIntValue(getAttr(ctMapping, "inspectTemplateIntervalFast"), -1); @@ -2944,6 +2948,11 @@ else if (hasCS) { log(config, log, t); } } + if (!hasDefault) { + list.add(new MappingImpl(config, "/default", "{lucee-config}/customtags/", null, ConfigPro.INSPECT_NEVER, -1, -1, true, false, true, true, false, true, + null, -1, -1)); + } + mappings = list.toArray(new Mapping[list.size()]); config.setCustomTagMappings(mappings); } @@ -5230,11 +5239,15 @@ else if (configServer != null) { } + // sct.setEL("inspectTemplate", "never"); + // sct.setEL("physical", "{lucee-config}/components/"); + // Web Mapping Array compMappings = ConfigWebUtil.getAsArray("componentMappings", root); hasSet = false; Mapping[] mappings = null; if (hasAccess) { + boolean hasDefault = false; if (compMappings.size() > 0) { Iterator it = compMappings.valueIterator(); List list = new ArrayList<>(); @@ -5249,6 +5262,8 @@ else if (configServer != null) { String archive = getAttr(cMapping, "archive"); boolean readonly = toBoolean(getAttr(cMapping, "readonly"), false); boolean hidden = toBoolean(getAttr(cMapping, "hidden"), false); + if ("{lucee-web}/components/".equals(physical) || "{lucee-server}/components/".equals(physical)) continue; + if ("{lucee-config}/components/".equals(physical)) hasDefault = true; String strListMode = getAttr(cMapping, "listenerMode"); if (StringUtil.isEmpty(strListMode)) strListMode = getAttr(cMapping, "listener-mode"); @@ -5276,6 +5291,11 @@ else if (configServer != null) { log(config, log, t); } } + if (!hasDefault) { + list.add(new MappingImpl(config, "/default", "{lucee-config}/components/", null, ConfigPro.INSPECT_NEVER, -1, -1, true, false, true, true, false, true, + null, -1, -1)); + } + mappings = list.toArray(new Mapping[list.size()]); config.setComponentMappings(mappings); } diff --git a/loader/build.xml b/loader/build.xml index 9f844c84d9..4a835e01a6 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index fe5c37f53c..bd954247cb 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.2.0-SNAPSHOT + 6.1.2.1-SNAPSHOT jar Lucee Loader Build