diff --git a/core/src/main/java/lucee/runtime/config/ConfigFactory.java b/core/src/main/java/lucee/runtime/config/ConfigFactory.java index f2217cef4c..7d83706b31 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) { @@ -398,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); } @@ -416,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 a835631eeb..48cfa921ad 100644 --- a/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java +++ b/core/src/main/java/lucee/runtime/config/ConfigWebFactory.java @@ -2966,6 +2966,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<>(); @@ -2980,6 +2981,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); @@ -2996,6 +3000,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); } @@ -5312,11 +5321,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<>(); @@ -5331,6 +5344,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"); @@ -5358,6 +5373,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/core/src/main/java/resource/fld/core-base.fld b/core/src/main/java/resource/fld/core-base.fld index 19100bf3a1..546610cbdf 100755 --- a/core/src/main/java/resource/fld/core-base.fld +++ b/core/src/main/java/resource/fld/core-base.fld @@ -7012,16 +7012,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 diff --git a/loader/build.xml b/loader/build.xml index 7d99f67ff7..d4e87f3494 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 7094bc02fb..752b6392f1 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.164-RC + 6.2.0.165-RC jar Lucee Loader Build