Created
December 14, 2016 08:27
-
-
Save anonymous/6f7985c318d0eda16ebd6c1b1a7726e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function verifyCompile(mapping){ | |
var pathtoSourceCode = expandPath(arguments.mapping); | |
var files = directoryList(path=pathtoSourceCode, recurse=true, filter="*.cf*"); | |
var passedFiles = []; | |
var failedFiles = []; | |
var failedErrors = {}; | |
for(f in files){ | |
try { | |
getPageContext().compile(contractPath(f)); | |
passedFiles.append(f); | |
} | |
catch(Any e){ | |
failedErrors[f] = e; | |
failedFiles.append(f); | |
} | |
} | |
return { "errors"=failedErrors, "passedFiles"=passedFiles, "failedFiles"=failedFiles }; | |
} | |
</cfscript> |
Is this Lucee-only code?
getPageContext().compile() doesn't appear to be available in Adobe ColdFusion. Is there a java function that will work with ACF?
Adobe's directoryList() doesn't support named parameters unless using CF2018+. According to a 2013 CF10 bug report, this issue was closed & considered trivial. It wasn't fixed until CF2018 even though CF2016 is not end-of-life yet.
https://tracker.adobe.com/#/view/CF-3540467
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Much better! Mine was a simple example but this could be a nice BIF