Closed (works as designed)
Project:
Drupal Technical Working Group
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Apr 2012 at 16:13 UTC
Updated:
12 Sep 2014 at 12:53 UTC
Jump to comment: Most recent
Comments
Comment #1
Crell commentedShouldn't we standardize on not using globals in the first place and leveraging dependency injection properly? :-) This seems like an unnecessary step.
Comment #2
pdrake commentedFor OO code, leveraging dependency injection is probably sufficient, but for code which remains firmly procedural (of which I imagine there will be some in D8), the dependencies have to be explicitly instantiated or made available within scope of the function, correct?
Comment #3
cosmicdreams commented@Crell, yes, the key of this issue is not the manner in which the information is passed to the function, just a standardization of where the information is passed from a outside of the class (when arguments are not used) to the inner scoping of a function.
I couldn't think of a better title and this issue only has a "title fail". If anyone has a proper description of the issue please rename it.
Comment #4
catchI actually prefer the $GLOBALS syntax since it's more clear in context where the value is coming from - for example it makes it much more difficult to confuse global $user and $account and similar.
Also this is so not a wscci issue.
Comment #5
sunComment #6
sunComment #7
wizonesolutionsGonna try taking a stab at this.
Comment #8
wizonesolutionsIsn't $GLOBALS the PHP way to do it (when absolutely necessary)?
Comment #9
jhodgdonThis issue is not ready for a patch yet. We first need to discuss and establish the standard.
Comment #10
jhodgdonCoding standards decisions are now supposed to be made by the TWG... and I don't think this is relevant to dependency injection any more?
Comment #11
Crell commentedI think this is in practice irrelevant now, per #1.
Comment #12
jhodgdonOK, let's just close this.