Skip to content

Commit

Permalink
Merge branch 'development' of github.com:ColdBox/coldbox-platform int…
Browse files Browse the repository at this point in the history
…o development
  • Loading branch information
lmajano committed Jul 15, 2024
2 parents 27f606e + 73bca12 commit 881ce09
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 25 deletions.
4 changes: 2 additions & 2 deletions system/Bootstrap.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ component serializable="false" accessors="true" {

// Process A ColdBox Request Only
// If the file is "index.(cfm|bxm)" then we will process it
if( reFindNoCase( "index\.(cfm|bxm)", listLast( arguments.targetPage, "/" ) ) ){
if ( reFindNoCase( "index\.(cfm|bxm)", listLast( arguments.targetPage, "/" ) ) ) {
processColdBoxRequest();
}

Expand All @@ -528,7 +528,7 @@ component serializable="false" accessors="true" {
);

// Process it
if( fileExists( cbController.locateFilePath( "index.bxm" ) ) ){
if ( fileExists( cbController.locateFilePath( "index.bxm" ) ) ) {
onRequestStart( "index.bxm" );
} else {
onRequestStart( "index.cfm" );
Expand Down
2 changes: 1 addition & 1 deletion system/FrameworkSupertype.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ component serializable="false" accessors="true" {
else if ( fileExists( UDFRelativePath & ".cfc" ) ) {
locatedPath = "/" & appMapping & "/" & udflibrary & ".cfc";
} else if ( fileExists( UDFRelativePath & ".bx" ) ) {
locatedPath = "/" & appMapping & "/" & udflibrary & ".bx";
locatedPath = "/" & appMapping & "/" & udflibrary & ".bx";
} else if ( fileExists( UDFRelativePath & ".cfm" ) ) {
locatedPath = "/" & appMapping & "/" & udflibrary & ".cfm";
} else if ( fileExists( UDFRelativePath & ".bxm" ) ) {
Expand Down
2 changes: 1 addition & 1 deletion system/async/tasks/ScheduledTask.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ component accessors="true" {
cleanupTaskRun();
// set next run time based on timeUnit and period
// ONLY if we are not forcing the task to run
if( !arguments.force ){
if ( !arguments.force ) {
setNextRunTime();
}
}
Expand Down
6 changes: 5 additions & 1 deletion system/ioc/Injector.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@ component serializable="false" accessors="true" {
// Check Scan Locations In Order
for ( var thisScanPath in scanLocations ) {
// Check if located? If so, return instantiation path
if ( fileExists( scanLocations[ thisScanPath ] & CFCName & ".cfc" ) || fileExists( scanLocations[ thisScanPath ] & CFCName & ".bx" ) ) {
if (
fileExists( scanLocations[ thisScanPath ] & CFCName & ".cfc" ) || fileExists(
scanLocations[ thisScanPath ] & CFCName & ".bx"
)
) {
return thisScanPath & "." & arguments.name;
}
}
Expand Down
2 changes: 1 addition & 1 deletion system/modules/HTMLHelper/models/HTMLHelper.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2937,7 +2937,7 @@ component
private string function prepareBaseLink( boolean noBaseURL = false, src ){
var baseURL = replaceNoCase(
requestService.getContext().getSESbaseURL(),
findNoCase( ".cfm", cgi.script_name ) ? "index.cfm" : "index.bxm",
findNoCase( ".cfm", cgi.script_name ) ? "index.cfm" : "index.bxm",
""
);
// return if base is eempty
Expand Down
6 changes: 5 additions & 1 deletion system/remote/ColdboxProxy.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ component serializable="false" accessors="true" {
var scriptName = CGI.SCRIPT_NAME;

// Only process this logic if hitting a remote proxy CFC directly and if ColdBox exists.
if ( len( scriptName ) < 5 || !reFindNoCase( "(cfc|bx)", right( scriptName, 4 ) ) || !verifyColdBox( throwOnNotExist = false ) ) {
if (
len( scriptName ) < 5 || !reFindNoCase( "(cfc|bx)", right( scriptName, 4 ) ) || !verifyColdBox(
throwOnNotExist = false
)
) {
return;
}

Expand Down
18 changes: 15 additions & 3 deletions system/web/config/ApplicationLoader.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,11 @@ component accessors="true" {
}
}
// Check if LogBoxConfig.cfc exists in the config conventions
else if ( fileExists( variables.controller.getAppRootPath() & "config/CacheBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/CacheBox.bx" ) ) {
else if (
fileExists( variables.controller.getAppRootPath() & "config/CacheBox.cfc" ) || fileExists(
variables.controller.getAppRootPath() & "config/CacheBox.bx"
)
) {
configStruct.cacheBox.configFile = loadCacheBoxByConvention( configStruct );
}
// else, load the default coldbox cachebox config
Expand Down Expand Up @@ -658,7 +662,11 @@ component accessors="true" {
arguments.config[ "LogBoxConfig" ] = logBoxConfig.getMemento();
}
// Check if LogBoxConfig.cfc exists in the config conventions and load it.
else if ( fileExists( variables.controller.getAppRootPath() & "config/LogBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/LogBox.bx" ) ) {
else if (
fileExists( variables.controller.getAppRootPath() & "config/LogBox.cfc" ) || fileExists(
variables.controller.getAppRootPath() & "config/LogBox.bx"
)
) {
loadLogBoxByConvention( logBoxConfig, arguments.config );
}
// Check if hash changed by means of programmatic object config
Expand Down Expand Up @@ -688,7 +696,11 @@ component accessors="true" {
arguments.config.wirebox.binderPath = wireBoxDSL.binder;
}
// Check if WireBox.cfc exists in the config conventions, if so create binder
else if ( fileExists( variables.controller.getAppRootPath() & "config/WireBox.cfc" ) || fileExists( variables.controller.getAppRootPath() & "config/WireBox.bx" ) ) {
else if (
fileExists( variables.controller.getAppRootPath() & "config/WireBox.cfc" ) || fileExists(
variables.controller.getAppRootPath() & "config/WireBox.bx"
)
) {
arguments.config.wirebox.binderPath = "config.WireBox";
if ( len( arguments.config.appMapping ) ) {
arguments.config.wirebox.binderPath = arguments.config.appMapping & ".#arguments.config.wirebox.binderPath#";
Expand Down
4 changes: 2 additions & 2 deletions system/web/routing/Router.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ component
****************************************************************/

property
name ="cachebox"
name ="cachebox"
inject ="cachebox"
delegate="getCache";
property
name ="controller"
inject ="coldbox"
inject ="coldbox"
delegate="relocate,runEvent,runRoute";
property name="flash" inject="coldbox:flash";
property name="logBox" inject="logbox";
Expand Down
11 changes: 7 additions & 4 deletions system/web/services/HandlerService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,7 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
}

// CFML View
if (
fileExists( expandPath( targetView & ".cfm" ) ) || fileExists( expandPath( targetView & ".bxm" ) )
) {
if ( fileExists( expandPath( targetView & ".cfm" ) ) || fileExists( expandPath( targetView & ".bxm" ) ) ) {
arguments.ehBean.setViewDispatch( true );
return true;
}
Expand Down Expand Up @@ -595,7 +593,12 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
// Convert windows \ to java /
arguments.directory = replace( arguments.directory, "\", "/", "all" );

return directoryList( arguments.directory, true, "array", "*.cfc|*.bx" ).map( function( item ){
return directoryList(
arguments.directory,
true,
"array",
"*.cfc|*.bx"
).map( function( item ){
var thisAbsolutePath = replace( item, "\", "/", "all" );
var cleanHandler = replaceNoCase( thisAbsolutePath, directory, "", "all" );
// Clean OS separators to dot notation.
Expand Down
6 changes: 5 additions & 1 deletion system/web/services/LoaderService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
coldboxSettings[ "ConfigFileLocationOverride" ] = false;

// verify coldbox.cfc exists in convention: /app/config/Coldbox.cfc
if ( fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".cfc" ) || fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".bx" ) ) {
if (
fileExists( appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".cfc" ) || fileExists(
appRootPath & replace( configFileLocation, ".", "/", "all" ) & ".bx"
)
) {
coldboxSettings[ "ConfigFileLocation" ] = configFileLocation;
}

Expand Down
30 changes: 25 additions & 5 deletions system/web/services/ModuleService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
// cleanup module name
var childName = listLast( thisChild, "/\" );
// verify ModuleConfig exists, else skip
if ( fileExists( thisChild & "/ModuleConfig.cfc" ) || fileExists( thisChild & "/ModuleConfig.bx" ) ) {
if (
fileExists( thisChild & "/ModuleConfig.cfc" ) || fileExists(
thisChild & "/ModuleConfig.bx"
)
) {
// add to parent children
arrayAppend( mConfig.childModules, childname );
// register child
Expand Down Expand Up @@ -689,7 +693,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
}

// Register Default Module Export if it exists as @moduleName, so you can do getInstance( "@moduleName" )
if ( fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.cfc" ) || fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.bx" ) ) {
if (
fileExists( mconfig.modelsPhysicalPath & "/#arguments.moduleName#.cfc" ) || fileExists(
mconfig.modelsPhysicalPath & "/#arguments.moduleName#.bx"
)
) {
mConfig.injector
.getBinder()
.map( [
Expand Down Expand Up @@ -752,7 +760,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
);

// config/Router Conventions
if ( fileExists( mConfig.routerPhysicalPath & ".cfc" ) || fileExists( mConfig.routerPhysicalPath & ".bx" ) ) {
if (
fileExists( mConfig.routerPhysicalPath & ".cfc" ) || fileExists(
mConfig.routerPhysicalPath & ".bx"
)
) {
// Process as a Router.cfc with virtual inheritance
mConfig.injector
.registerNewInstance(
Expand Down Expand Up @@ -823,7 +835,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
| Module Schedulers
|--------------------------------------------------------------------------
*/
if ( fileExists( mConfig.schedulerPhysicalPath & ".cfc" ) || fileExists( mConfig.schedulerPhysicalPath & ".bx" ) ) {
if (
fileExists( mConfig.schedulerPhysicalPath & ".cfc" ) || fileExists(
mConfig.schedulerPhysicalPath & ".bx"
)
) {
mConfig.scheduler = variables.controller
.getSchedulerService()
.loadScheduler(
Expand Down Expand Up @@ -1278,7 +1294,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
mConfig.settings.append( globalModuleSettings[ mConfig.modelNamespace ], true );

// config/{mConfig.modelNamespace}.cfc overrides
if ( fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.cfc" ) || fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.bx" ) ) {
if (
fileExists( "#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.cfc" ) || fileExists(
"#appSettings.applicationPath#config/modules/#mConfig.modelnamespace#.bx"
)
) {
loadModuleSettingsOverride( mConfig, mConfig.modelNamespace );
}
}
Expand Down
12 changes: 10 additions & 2 deletions system/web/services/RoutingService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {

// Discover router: app or base
var configFilePath = variables.routingAppMapping & modernRouter.replace( ".", "/", "all" );
var routerType = ( fileExists( expandPath( configFilePath & ".cfc" ) ) || fileExists( expandPath( configFilePath & ".bx" ) ) ) ? "modern" : "base";
var routerType = (
fileExists( expandPath( configFilePath & ".cfc" ) ) || fileExists(
expandPath( configFilePath & ".bx" )
)
) ? "modern" : "base";

// Check if base router mapped?
if ( NOT wirebox.getBinder().mappingExists( baseRouter ) ) {
Expand Down Expand Up @@ -996,7 +1000,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
}

// Clean up the path_info from index
results[ "pathInfo" ] = reReplaceNoCase( results[ "pathInfo" ], "^[/\\]index\.(cfm|bxm)", "" );
results[ "pathInfo" ] = reReplaceNoCase(
results[ "pathInfo" ],
"^[/\\]index\.(cfm|bxm)",
""
);

// Clean the scriptname from the pathinfo if it is the first item in case this is a nested application
if ( len( results[ "scriptName" ] ) ) {
Expand Down
6 changes: 5 additions & 1 deletion system/web/services/SchedulerService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ component extends="coldbox.system.web.services.BaseService" accessors="true" {
}

// Check if the convention exists, else just build out a simple scheduler
if ( fileExists( variables.appPath & "config/Scheduler.cfc" ) || fileExists( variables.appPath & "config/Scheduler.bx" ) ) {
if (
fileExists( variables.appPath & "config/Scheduler.cfc" ) || fileExists(
variables.appPath & "config/Scheduler.bx"
)
) {
schedulerPath = (
variables.appMapping.len() ? "#variables.appMapping#.#appSchedulerConvention#" : appSchedulerConvention
);
Expand Down

0 comments on commit 881ce09

Please sign in to comment.