Wasn’t it just a bug that it wasn’t doing what this new behaviour implements anyhow? The function is clearly intended to return the app settings, not “all the this scope of the Application object”.
It seems to me the better solution here would be to simply make it do what it claimed to do, and don’t return all the cruft it wasn’t intended to do.
I would not implement this new boolean param to make it do what it was supposed to in the first place: I’d just fix the bug. plus in the process I’d ditch the other param too, as that was just a a partial “fix” for the situation too, by the looks?
As for potential “backwards compat” concerns… this is in 6.x, a major release, so it would be completely fine to have a bugfix that is a “breaking change”. I mean almost all bugfixes are a breaking change anyhow, really, right? Given a bugfix is generally gonna change the existing behaviour of whatever it is a fix for…
I don’t think this is moving the language forward.
Given the various existing caveats listed like extension settings not being returned (that’s going to need some additional plumbing in the future) and aliases, your proposal would mean that you couldn’t even get all the application settings?
No, my proposal is that the function should do what it’s documented to do / intended to do, which it’s currently clearly not. Pretty sure my initial wording was clear on that mark.
The function is getApplicationSettings. Application settings. And it’s clearly documented what that means in the docs I pointed to. So that’s what it should do. And all it should do. Not “oh and does something different if you pass it this flag param”. That’s poor practice.
If extensions need to expose settings… cool… that’s something else. And probably down to the extension codebase to deal with. Or a function getExtensionSettings or something. But I don’t think it’s really Lucee’s job, nor handling it in a global way is very good either.
Equally if you additionally need a function getAllApplicationPublicStuff (might wanna work on that name ;-)), then that is something different too. It’s different from getApplicationSettings, and it’s different from getExtensionSettings.
It seems to me that there are perhaps two issues here:
getApplicationSettings is not doing what it’s supposed to.
fixing that first point shows at least a perceived additional shortfall that there is no functionality along the lines of getAllApplicationPublicStuff, and that possibly needs implementing too.
Rolling both of those into one function that is clearly intended to only do one of those things is not a great solution.
Only semi-related… I actually challenge the merit of the practice of parking “other stuff” in the this scope of the Application. It’s probably not a good way of dealing with whatever needs to be done. EG: an extension should manage / expose its own settings, not dump them in some global space; variables needing to be accessed outside Application’s own code are probably better placed in application / session / request scopes as appropriate, or managed more thoughtfully entirely (as properties of an object etc). I don’t know that it’s for Lucee to enable random dumping of stuff in the Application’s this scope because one can’t be arsed working out where better to put it.