Skip to content

Commit

Permalink
Merge pull request #3 from GiancarloGomez/feature/box-142-cb-proxies-…
Browse files Browse the repository at this point in the history
…base-proxy-update-for-box-lang-support

Added isBoxLang to BaseProxy variables
  • Loading branch information
lmajano authored May 22, 2024
2 parents f55b158 + 0450e0f commit 81907f7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions models/BaseProxy.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ component accessors="true" {
variables.loadAppContext = arguments.loadAppContext;
variables.threadHashCode = getCurrentThread().hashCode();

variables.isLucee = server.keyExists( "lucee" );
variables.isAdobe = server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNocase( "ColdFusion" ) > 0;
variables.isAdobe = server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNocase( "ColdFusion" ) > 0;
variables.isBoxLang = server.keyExists( "boxlang" );
variables.isLucee = server.keyExists( "lucee" );

// If loading App context or not
if ( arguments.loadAppContext ) {
if ( arguments.loadAppContext && !variables.isBoxLang ) {
if ( variables.isLucee ) {
variables.cfContext = getCFMLContext().getApplicationContext();
variables.pageContext = getCFMLContext();
Expand Down Expand Up @@ -97,8 +98,11 @@ component accessors="true" {
* Ability to load the context into the running thread
*/
function loadContext(){
// Are we loading the context or not? Or we are in the same running main thread
if ( !variables.loadAppContext || variables.threadHashCode == getCurrentThread().hashCode() ) {
// If we are in BoxLang, exit out as context is handled differently.
// Or Are we loading the context or not? Or we are in the same running main thread
if (
variables.isBoxLang || !variables.loadAppContext || variables.threadHashCode == getCurrentThread().hashCode()
) {
return;
}

Expand Down Expand Up @@ -158,8 +162,11 @@ component accessors="true" {
* Ability to unload the context out of the running thread
*/
function unLoadContext(){
// If we are in BoxLang, exit out as context is handled differently.
// Are we loading the context or not? Or we are in the same running main thread
if ( !variables.loadAppContext || variables.threadHashCode == getCurrentThread().hashCode() ) {
if (
variables.isBoxLang || !variables.loadAppContext || variables.threadHashCode == getCurrentThread().hashCode()
) {
return;
}

Expand Down

0 comments on commit 81907f7

Please sign in to comment.