Skip to content

Commit

Permalink
LDEV-4994 - remove PageContext that is not needed anyway anymore (was…
Browse files Browse the repository at this point in the history
… needed only for Lucee 5)
  • Loading branch information
michaeloffner committed Jul 12, 2024
1 parent 4f7d7bd commit bd0f5c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
22 changes: 1 addition & 21 deletions core/src/main/java/lucee/runtime/config/CFConfigImport.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
package lucee.runtime.config;

import java.io.File;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Map.Entry;

import lucee.commons.io.DevNullOutputStream;
import lucee.commons.io.SystemUtil;
import lucee.commons.io.log.LogUtil;
import lucee.commons.io.res.Resource;
import lucee.commons.lang.ExceptionUtil;
import lucee.loader.engine.CFMLEngine;
import lucee.loader.engine.CFMLEngineFactory;
import lucee.loader.util.Util;
import lucee.runtime.PageContext;
import lucee.runtime.engine.ThreadLocalPageContext;
import lucee.runtime.exp.PageException;
import lucee.runtime.interpreter.JSONExpressionInterpreter;
import lucee.runtime.op.Caster;
import lucee.runtime.thread.SerializableCookie;
import lucee.runtime.type.Collection;
import lucee.runtime.type.Collection.Key;
import lucee.runtime.type.KeyImpl;
import lucee.runtime.type.Struct;
import lucee.runtime.util.Cast;
import lucee.runtime.util.PageContextUtil;

public class CFConfigImport {

Expand Down Expand Up @@ -98,18 +92,9 @@ public CFConfigImport(Config config, Struct data, Charset charset, String passwo
}

public Struct execute(boolean throwException) throws PageException {
boolean unregister = false;
PageContext pc = ThreadLocalPageContext.get();
Struct json = null;

try {
if (pc == null) {

pc = PageContextUtil.getPageContext(config, null, (File) SystemUtil.getTempDirectory(), "localhost", "/", "", SerializableCookie.COOKIES0, null, null, null,
DevNullOutputStream.DEV_NULL_OUTPUT_STREAM, true, 100000, false);
unregister = true;

}
if (validatePassword && Util.isEmpty(password)) {
String sysprop = "lucee." + type.toUpperCase() + ".admin.password";
String envVarName = sysprop.replace('.', '_').toUpperCase();
Expand Down Expand Up @@ -162,12 +147,7 @@ public Struct execute(boolean throwException) throws PageException {
if (throwException) {
throw Caster.toPageException(t);
}
else LogUtil.log(pc, "deploy", t);
}
finally {
if (unregister) {
pc.getConfig().getFactory().releaseLuceePageContext(pc, true);
}
LogUtil.log("deploy", "config-imprt", t);
}
if (throwException && exd != null) throw exd;
return json;
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="6.1.1.39-SNAPSHOT"/>
<property name="version" value="6.1.1.40-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>6.1.1.39-SNAPSHOT</version>
<version>6.1.1.40-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit bd0f5c7

Please sign in to comment.