Skip to content

Commit

Permalink
Merge pull request #1 from michaelborn/michaelborn-patch-1
Browse files Browse the repository at this point in the history
Add BoxLang support to Consumer.cfc
  • Loading branch information
michaelborn authored Nov 25, 2024
2 parents df48cd1 + 5168f97 commit 2a99b75
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions models/Consumer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ component accessors="true"{
variables.oneHundredYears = ( 60 * 60 * 24 * 365 * 100 );
variables.loadAppContext = arguments.loadAppContext;

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 ( server.keyExists( "lucee" ) ) {
variables.cfContext = getCFMLContext().getApplicationContext();
variables.pageContext = getCFMLContext();
Expand Down Expand Up @@ -211,9 +215,9 @@ component accessors="true"{
// out( "==> Context NOT loaded for thread: #getCurrentThread().toString()# loading it..." );

// Lucee vs Adobe Implementations
if ( server.keyExists( "lucee" ) ) {
if ( variables.isLucee ) {
getCFMLContext().setApplicationContext( variables.cfContext );
} else {
} else if( variables.isAdobe ) {
var fusionContext = variables.originalFusionContext.clone();
var pageContext = variables.originalPageContext.clone();
pageContext.resetLocalScopes();
Expand Down Expand Up @@ -244,9 +248,9 @@ component accessors="true"{
// out( "==> Removing context for thread: #getCurrentThread().toString()#." );

// Lucee vs Adobe Implementations
if ( server.keyExists( "lucee" ) ) {
if ( variables.isLucee ) {
// Nothing right now
} else {
} else if ( variables.isAdobe ) {
variables.fusionContextStatic.setCurrent( javacast( "null", "" ) );
}
}
Expand Down Expand Up @@ -276,10 +280,10 @@ component accessors="true"{
* Ammend this check once Adobe fixes this in a later update
*/
function getConcurrentEngineLockName(){
if ( server.keyExists( "lucee" ) ) {
return createUUID();
} else {
if ( variables.isAdobe ) {
return variables.UUID;
} else {
return createUUID();
}
}
}
}

0 comments on commit 2a99b75

Please sign in to comment.