-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate redundant HTTP keys #3973
Conversation
I just checked and they still seem to be in use, e.g., here: CodeIgniter4/system/HTTP/Exceptions/HTTPException.php Lines 242 to 245 in a2de1f6
and in the corresponding tests. I'm all for dropping as many duplicates as possible but not sure if it makes sense to change HTTP to Security in the above example.
|
Can we maybe add some testing for all language strings called in the framework to see if they are really defined? |
I like @sfadschm's idea, it could even be implemented as an Action for PRs. It should check both directions: for language calls missing a key and for unused keys. For this PR, and generally, I think that we need to deprecate language strings instead of removing them because any module or project could be using the framework strings. While it technically would not crash the code the output could suddenly change to something unhelpful like "System.description" |
Checking both directions sounds reasonable. I thought about such tests some days ago, but the only thing I could come up with was to load all language keys, then read the contents of all framework files and I agree on the deprecation, but I think we can not really have both tests and deprecation, as the tests would have no way to tell a language string has already been deprecated and should not throw an error, or am I missing out on something? |
I believe system messages should be strictly for internal use and should not be used in users' code and covered by BC promise. The usage should remain strictly in the framework alone and users should implement their own keys. Since these messages are typically used within thrown exceptions, users wanting to use the messages should use it rather indirectly, i.e. using the |
I'm with you on this, but I still also think that there is projects out there using those messages, which will face some unexpected messages like MGatner said. How about applying this to 4.1 with a note in the update changelog and maybe a small notice in the user manual, that these keys are not BC covered? |
@paulbalandan What do you think of @sfadschm's idea? I think that is a good compromise: we add a comment that these are deprecated but leave them, then note in the UG and changelog for 4.1 the system language strings are all considered internal and can be changed without warning. @lonnieezell I think you should weigh in on this as well. |
I agree system messages are intended to be for internal use. I like the suggested compromise. |
0819d6f
to
7ee9ae5
Compare
7ee9ae5
to
92bfe95
Compare
Key deprecation looks good. The PHP 8 SA is allowed (#4065). What about a line in the UG and changelog about language files being internal? or were you thinking that would be a separate PR? |
Yes, I'm thinking of a separate PR for them. |
Description
With the merge of the refactored Security class, the redundant
HTTP.disallowedAction
andHTTP.invalidSamSiteSetting
can be removed in favor of theSecurity
counterpart.Checklist: