Skip to content

Commit

Permalink
Merge pull request #4 from coldbox-modules/development
Browse files Browse the repository at this point in the history
BoxLang Support
  • Loading branch information
lmajano authored May 22, 2024
2 parents 0b99f6e + e2926a7 commit ca045ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"cbproxies",
"version":"1.2.0",
"version":"1.3.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbproxies/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"homepage":"https://github.com/coldbox-modules/cbproxies",
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- BoxLang Support

## [1.2.0] - 2024-04-10

## [1.1.0] - 2023-04-28

### Added

- Better engine recognition in base proxy
- Added Adobe 2023 support

Expand Down
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 ca045ad

Please sign in to comment.