[TYPO3-core] Wrapper methods around globals?

Nicole Cordes typo3 at cordes.co
Thu Apr 3 15:59:55 CEST 2014


Hi, 

I can't say anything about the performance but we used to do this for unit
testing as this ist he only way tob e able to mock certain global variables.

Hopefully there will be some other solutions for GLOBALS in IDE asap.

BTW: I was thinking about an core PhpStorm meta data file which we could
provide as well?


Best regards,
Nicole

--
Nicole Cordes
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org

-----Ursprüngliche Nachricht-----
Von: typo3-team-core-bounces at lists.typo3.org
[mailto:typo3-team-core-bounces at lists.typo3.org] Im Auftrag von Dmitry
Dulepov
Gesendet: Donnerstag, 3. April 2014 08:54
An: typo3-team-core at lists.typo3.org
Betreff: Re: [TYPO3-core] Wrapper methods around globals?

Hi!

François Suter wrote:
> In a patch I submitted this morning [1], I added a wrapper method 
> around $GLOBALS['BE_USER'], because it makes it much easier to work 
> with such globals in an IDE, having type hinting and code completion. 
> I did it because I saw other places in the Core using this way of doing
this.
>
> Now Kay Strobach thinks this should not be done for performance reasons.

I do not think that a function call to return a variable vs access the
variable directly would be comparable in performance impact to any of
hundreds useless database calls we do during user auth for each request. 
So, I say, go for your change. It is useful.

--
Dmitry Dulepov

Today is a good day to have a good day.
_______________________________________________
Before posting to this list, please have a look to the posting rules on the
following websites:

http://typo3.org/teams/core/core-mailinglist-rules/
http://typo3.org/development/bug-fixing/diff-and-patch/
_______________________________________________
TYPO3-team-core mailing list
TYPO3-team-core at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core



More information about the TYPO3-team-core mailing list