Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#1 | stream_wrappers-psr0.patch | 43.97 KB | amateescu |
Comments
Comment #1
amateescu CreditAttribution: amateescu commentedNoteworthy things about this patch:
Comment #2
Dave ReidThis mostly makes sense to me. I get dropping the 'Drupal' part from the class names, but it seemed odd to me that the classes now just have 'Stream' as a suffix rather than 'StreamWrapper' or no suffix at all.
Comment #3
Dave ReidAfter a little more review I'm totally fine with the renaming proposal in #1 based on the PHP example 'VariableStream' from http://us.php.net/manual/en/stream.streamwrapper.example-1.php. Makes sense for us to follow along. I don't quite feel comfortable marking this as RTBC so I'd like to leave that to another reviewer a little better versed in the PSR-0 conversions.
Comment #4
Crell CreditAttribution: Crell commentedResource isn't a class. It's a PHP language type, like int or string. So it should probably stay lowercase.
I would also recommend putting the free-floating constants in the interface. They can lazy-load that way, and it's a model that Symfony is already using in places (HttpKernelInterface, for instance) so it would be consistent.
I'm fine with the class renames.
19 days to next Drupal core point release.
Comment #5
amateescu CreditAttribution: amateescu commentedWut? The patch is changing it to lowercase. You meant leaving it as title case?
I don't think that's possible atm, because file.inc uses them before initializing any stream wrapper class, for example: http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/inclu...
Maybe we should leave this for a file.inc clean-up issue?
Yay :)
Comment #6
Crell CreditAttribution: Crell commentedEr. I can't read. Yes, you're lowercasing them, which is correct.
For the constants on the interface, as long as the interface is loadable by the class loader before file.inc is included, it will work. That's the whole point of the class loader. :-)
That said, some of them (the ones that are define()s now) couldn't do that anyway, since class constants like global const are compile-time specified, not runtime. So... eh, yeah, I guess we could leave them. No strong preference either way.
Yeah, let's just go ahead and do it then. :-)
Comment #7
Dries CreditAttribution: Dries commentedGreat, this all looks good. Committed to 8.x. Thanks!
Comment #8
sunThe new files were not added.
Comment #9
pounardClasses should be named LocalStreamWrapper not LocalStream IMHO.
EDIT: "Local" would mean something, but would be confusing when used without alias in external code, LocalStreamWrapper is explicit and a good name to use, while "LocalStream" is an intermediate name that doesn't mean anything: "Stream" is a too common word and might be used in many other contextes, it has nothing to do with "StreamWrapper", I think we should go for fully explicit name.
Comment #10
amateescu CreditAttribution: amateescu commented@pounard, see #3.
Comment #11
pounardIndeed, it's still sounds weird. If the interface is named "StreamWrapper" then classes should be named "SomethingStreamWrapper", if we go for "SomethingStream" the interface should be renamed too.
Comment #12
webchickOk. After about 30 minutes of back and forth with sun and some other folks in IRC, I think I managed to fix this. ;)