Skip to content

Commit

Permalink
Merge branch '5.4' of https://github.com/lucee/Lucee into 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Nov 6, 2023
2 parents 6da7064 + 120c96a commit cadb63f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/lucee/runtime/type/scope/CGIImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ public Object get(PageContext pc, Collection.Key key, Object defaultValue) {
}
else if (first == 'c') {
if (key.equals(KeyConstants._context_path)) return store(key, toString(req.getContextPath()));
if (key.equals(KeyConstants._cfid)) {
if (pc == null) pc = ThreadLocalPageContext.get();
return pc.getCFID();
}
if (key.equals(KeyConstants._cf_template_path)) return store(key, getPathTranslated());
}
else if (first == 'h') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ public Object get(PageContext pc, Collection.Key key, Object defaultValue) {
}
else if (first == 'c') {
if (key.equals(KeyConstants._context_path)) return toString(req.getContextPath());
if (key.equals(KeyConstants._cfid)) {
if (pc == null) pc = ThreadLocalPageContext.get();
return pc.getCFID();
}
if (key.equals(KeyConstants._cf_template_path)) return getPathTranslated();
}
else if (first == 'h') {
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="5.4.4.28-SNAPSHOT"/>
<property name="version" value="5.4.4.29-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>5.4.4.28-SNAPSHOT</version>
<version>5.4.4.29-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down
12 changes: 7 additions & 5 deletions loader/src/main/java/lucee/debug/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ public static void main(String[] args) throws Exception {

System.setProperty("lucee.controller.disabled", "true");

String webxml = getSystemPropOrEnvVar(ARG_WEBXML, "");
if (webxml.isEmpty())
webxml = Main.class.getResource("/debug/web.xml").getPath();

s = getSystemPropOrEnvVar(ARG_BASE, DEF_BASE);

String appBase = (new File(s)).getCanonicalPath().replace('\\', '/');
String docBase = appBase + "/webroot";
String webxml = getSystemPropOrEnvVar(ARG_WEBXML, docBase + "/WEB-INF/web.xml");

System.out.println("Setting appBase: " + appBase);
System.out.println("Setting docBase: " + docBase);
System.out.println("Setting web.xml: " + webxml);

File f = new File(webxml);
if (!f.exists())
throw(new IllegalArgumentException("web.xml not found at " + webxml));

Class clsTomcat = Class.forName("org.apache.catalina.startup.Tomcat");
Method tAddWebApp = clsTomcat.getMethod("addWebapp", String.class, String.class);
Expand Down Expand Up @@ -68,7 +70,7 @@ public static void main(String[] args) throws Exception {
cSetResourceOnlyServlets.invoke(oContext, "CFMLServlet");

System.out.println(
tGetConnector.invoke(oTomcat)
tGetConnector.invoke(oTomcat)
);

// tomcat.start()
Expand Down
14 changes: 14 additions & 0 deletions loader/src/main/java/lucee/loader/engine/CFMLEngineFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,20 @@ private void initEngine() throws ServletException {
}
}

if (is == null) {
// check for custom path of Lucee core
String s = System.getProperty("lucee.core.path");
if (s != null) {
System.err.println("Searching for Lucee Core at " + s);
File dir = new File(s);
File[] files = dir.listFiles(new ExtensionFilter(new String[] { coreExt }));
if (files.length > 0) {
System.err.println("Using Lucee Core from " + files[0].toString());
is = new FileInputStream(files[0]);
}
}
}

if (is != null) {
os = new BufferedOutputStream(new FileOutputStream(isPack200 ? rcPack200 : rc));
copy(is, os);
Expand Down

0 comments on commit cadb63f

Please sign in to comment.