Skip to content

Commit

Permalink
Update compareDefault.cfm
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jun 24, 2024
1 parent 1e521af commit b7b9d87
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions custom/default-cfconfig/compareDefault.cfm
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
<cfscript>
default = deserializeJSON( fileRead( expandPath( "./.CFConfig-default.json" ) ) );
empty = deserializeJSON( fileRead( expandPath('{lucee-config}.CFConfig.json') ) );
ignore = [ "salt", "hspw" ];
problems = 0;
for ( cfg in default.keyList() ){
if (!structKeyExists( empty, cfg ) ){
if ( arrayContains( ignore, cfg ) ) {
//ignore
} else if (!structKeyExists( empty, cfg ) ){
systemOutput("", true );
systemOutput("#cfg# missing in empty .CFConfig.json", true );
problems++;
} else {
if ( empty[cfg].toJson() neq default[cfg].toJson() ){
if ( empty[ cfg ].toJson() neq default[ cfg ].toJson() ){
systemOutput("", true );
systemOutput("#cfg# is different!", true );
systemOutput("#chr(9)# empty : #empty[cfg].toJson()# ", true );
systemOutput("#chr(9)# default: #default[cfg].toJson()# ", true );
systemOutput("#chr(9)# empty : #empty[ cfg ].toJson()# ", true );
systemOutput("#chr(9)# default: #default[ cfg ].toJson()# ", true );
problems++;
}
}
}
if ( problems > 0 ){
throw "#problems# config elements were different!";
}
</cfscript>

0 comments on commit b7b9d87

Please sign in to comment.