35751[!!!][BUGFIX] Avoid makeInstance calls starting with a backslash
Commit message
Review
-
Code review CR +2
- Markus Klein +2
- Stefan Froemken +1
-
Verified V +2
- Markus Klein +2
- Stefan Froemken +1
Issues 1
Files 2
Review log 27
Show 2 earlier messages
-
Anja Leichsenring voted on patch set 2 CR +1 V +1 01/03/15, 13:05
-
Benni Mack commented on patch set 2 01/03/15, 13:40
-
Markus Klein commented on patch set 2 01/03/15, 14:46
I disagree about the exception, I would prefer a graceful code that just removes the leading backslash -
Wouter Wolters commented on patch set 2 01/03/15, 14:50
IMO no, that makes the classloading slower again! -
Markus Klein commented on patch set 2 01/03/15, 15:24
Are we sure the core itself is clean of such calls? -
Benni Mack uploaded patch set 3 01/03/15, 15:36
-
Benni Mack commented on patch set 3 01/03/15, 15:37
We already have that logic in the class loader. The exception is so that coders write clean code in CMS7, for 6.2 I will create a different patch with a graceful removal of the first part to solve the problem described in the issue. -
Markus Klein commented on patch set 3 01/03/15, 16:18
@Wouter: I don't consider a ltrim(, '\\') much slower. We need the check for === '\\' anyway -
Helmut Hummel commented on patch set 3 01/03/15, 18:51
@Markus: > I disagree about the exception It is a programming error passing a leading slash to makeInstance. Error conditions should be converted to exceptions (like PHP warnings are at least in development context). I disagree to be graceful here. > Are we sure the core itself is clean of such calls? Yes. I would have been pretty sure before we replaced class names in strings with ::class. Since we have done it now, I'm even more convinced that there are no such places in the core. And if I'm wrong here, this change is a great opportunity to catch these mistakes and fix them as no-brainers. -
Markus Klein commented on patch set 3 01/03/15, 23:42
Alright, fine with me then. -
Stefan Froemken commented on patch set 3 01/04/15, 21:42
Container.php:150It does not make sense here. instanciateObject() calls makeInstance which throws an Exception. The registration of Singletons are also done in instanciateObject(). I would prefer to remove these lines. -
Helmut Hummel commented on patch set 3 01/05/15, 10:08
Container.php:150Replygood point! Since we throw an exception and not gracefully trim the first slash, this can be removed. But for 6.2 we must keep the trimming of the first slash here as directly after that, the the singleton registry is looked up. -
Benni Mack uploaded patch set 4 01/06/15, 12:22
-
Benni Mack commented on patch set 4 01/06/15, 12:23
Another bugfix with a silent cleanup will follow for 6.2 once this patch is in. -
Stefan Froemken voted on patch set 4 CR +1 V +1 01/06/15, 13:11
-
Markus Klein voted on patch set 4 CR +2 V +2 01/06/15, 16:02
-
Markus Klein merged patch set 4 01/06/15, 16:02
-
Oliver Klee commented on patch set 5 01/06/15, 17:59
Nice! <3 -
Mathias Brodala commented on patch set 5 01/07/15, 09:00
Copied from https://review.typo3.org/35836: I was under the impression that any extension running with 7.0 would be able to run with any 7.x. This is not true anymore here; an extension using this is compatible with 7.0 and 7.1 but not with 7.2. If I understand the development/release process of 7.x correctly than this should at most trigger a deprecation warning and only throw an exception with 8.x. -
Markus Klein commented on patch set 5 01/07/15, 10:13
Well, I opted to be graceful, but majority was for a hard exception. -
Mathias Brodala commented on patch set 5 01/07/15, 10:19
@Helmut as one of the release managers for 7.x could you elaborate on this a little more? -
Helmut Hummel commented on patch set 5 01/07/15, 11:05
For this very change, it is a great opportunity to fix the code in third party extensions that previously was wrong. Such fixed code will work great in previous versions. In addition it is very easy to fix. We could even provide a code migration, which we planned to have anyway. There are other changes in latest master which are much more breaking (e.g. removed deprecations which weren't removed in 7.0). We need to figure out a good migration path for these, which is still a todo topic. Besides that, we cannot really promise (and I assume we did not strictly did) that every extension that works with 7.0 will work without (slight) adaption in 7.x. We can only promise to make the migration as smooth as possible. -
Mathias Brodala commented on patch set 5 01/07/15, 11:12
Thanks for clarification. That means in this case a documentation of the breaking change is missing according to the blueprint (http://wiki.typo3.org/Blueprints/Release#Breaking_changes): "Breaking changes in minor versions (i.e. 7.0 to 7.1) are generally not allowed. Exceptions: ... Breaking changes without an automated migration path require a textual migration documentation" -
Helmut Hummel commented on patch set 5 01/07/15, 14:12
OK, what is actually really missing here in this change is a breaking rest document
Container.php:150