Skip to content

Commit

Permalink
Merge pull request #7 from michaelborn/development
Browse files Browse the repository at this point in the history
Add BoxLang support to Consumer.cfc
  • Loading branch information
lmajano authored Nov 25, 2024
2 parents df48cd1 + 2a99b75 commit 71b48d9
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 71b48d9

Please sign in to comment.