Skip to content

Commit

Permalink
- Better engine recognition in base proxy
Browse files Browse the repository at this point in the history
- Added Adobe 2023 support
  • Loading branch information
lmajano committed Apr 10, 2024
1 parent fd81afe commit d933b27
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: Ortus-Solutions/[email protected].2
- uses: Ortus-Solutions/[email protected].3
with:
cmd: run-script format:check
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup CommandBox
uses: Ortus-Solutions/[email protected]
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:

- name: Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.MODULE_ID }}
path: |
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
steps:
# Checkout development
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: development

Expand All @@ -148,7 +148,7 @@ jobs:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.MODULE_ID }}
path: .tmp
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
name: Code Auto-Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Auto-format
uses: Ortus-Solutions/[email protected].2
uses: Ortus-Solutions/[email protected].3
with:
cmd: run-script format

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ jobs:
strategy:
fail-fast: false
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021", "adobe@2023" ]
experimental: [ false ]
include:
- cfengine: "adobe@2023"
experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# - name: Setup Database and Fixtures
# run: |
Expand Down Expand Up @@ -82,7 +79,7 @@ jobs:

- name: Upload Test Results to Artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }}
path: |
Expand All @@ -95,7 +92,7 @@ jobs:
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
Expand Down
1 change: 1 addition & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"no-duplicate-header" : {
"siblings_only" : true
},
"no-duplicate-heading" : false,
"no-inline-html" : false
}
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

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

## [1.1.0] - 2023-04-28

### Added
Expand Down
20 changes: 11 additions & 9 deletions models/BaseProxy.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ 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;

// If loading App context or not
if ( arguments.loadAppContext ) {
if ( server.keyExists( "lucee" ) ) {
if ( variables.isLucee ) {
variables.cfContext = getCFMLContext().getApplicationContext();
variables.pageContext = getCFMLContext();
} else {
} else if( variables.isAdobe ) {
variables.DataSrcImplStatic = createObject( "java", "coldfusion.sql.DataSrcImpl" );
variables.fusionContextStatic = createObject( "java", "coldfusion.filter.FusionContext" );
variables.originalFusionContext = fusionContextStatic.getCurrent().clone();
Expand Down Expand Up @@ -103,9 +106,9 @@ component accessors="true" {

try {
// Lucee vs Adobe Implementations
if ( server.keyExists( "lucee" ) ) {
if ( variables.isLucee ) {
getCFMLContext().setApplicationContext( variables.cfContext );
} else {
} else if( variables.isAdobe ) {
// Set the current thread's class loader from the CF space to avoid
// No class defined issues in thread land.
getCurrentThread().setContextClassLoader(
Expand Down Expand Up @@ -164,8 +167,7 @@ component accessors="true" {

try {
// Lucee vs Adobe Implementations
if ( server.keyExists( "lucee" ) ) {
} else {
if( variables.isAdobe ) {
// Ensure any DB connections used get returned to the connection pool. Without clearSqlProxy an executor will hold onto any connections it touched while running and they will not timeout/close, and no other code can use the connection except for the executor that last touched it. Credit to Brad Wood for finding this!
variables.DataSrcImplStatic.clearSqlProxy();
variables.fusionContextStatic.setCurrent( javacast( "null", "" ) );
Expand Down Expand Up @@ -199,10 +201,10 @@ component accessors="true" {
* Amend 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();
}
}

Expand Down

0 comments on commit d933b27

Please sign in to comment.