Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Aug 2013 at 07:11 UTC
Updated:
26 Nov 2015 at 06:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerRelated issue #2002606: Allow themes to provide services.yml
Comment #2
ParisLiakos commentedi think keeping the drupal_get_filename() call though is good, so lets keep call system_register
lets see if something breaks
Comment #4
ParisLiakos commentedso we actually have a test for this;)
Drupal\system\Tests\Theme\ThemeTest->testClassLoading()Comment #5
ParisLiakos commentedComment #7
berdir#5: drupal-classloader_themes-2070581-5.patch queued for re-testing.
Comment #8
longwaveThe test was deliberately added in #1538478: Register lib/ directories of themes as PSR-0 roots for Drupal\$theme namespace, and back then it was decided that themes *should* be able to autoload classes if they need them. What benefits do we get from removing this?
Comment #9
iamEAP commentedRelevant discussion from #8:
Crell:
sun:
Comment #10
xjmThe patch here couldn't be automatically rerolled for #2247991: [May 27] Move all module code from …/lib/Drupal/… to …/src/… for PSR-4 (the only one among best-guess patches that apply), but it sounds like maybe this issue is a wontfix anyway?
Comment #11
xjmChanged my mind; not tagging based on #8 and #9.
Comment #12
markhalliwellSigh... I really cannot wrap my head around why themes are consistently targeted as "lower class". This mentality has to stop. Seriously.
They have PHP code and I don't see that going away anytime soon. Until themes don't have a single line of PHP code, something like this should never be added.
Limiting a theme's ability to utilize native and fundamental PHP syntax just because they haven't been using them is extremely presumptuous.
The primary reason themes haven't used namespaces in the past is because 7.x didn't support them out-of-the-box and would require themes to add a module dependency (which is very difficult to support in a theme).
Thus, namespaces really hasn't be an "official thing" until 8.x and I, for one, am rather excited to start using them to finally organize and OO some of the Bootstrap base theme's code.
So, as a themer and maintainer of one of the top d.o themes, I'm marking this as "won't fix".