merged branch deadbeef84/getglobals-before-addglobal-bug (PR #990)
merged branch deadbeef84/getglobals-before-addglobal-bug (PR #990)

This PR was merged into the master branch.

Commits
-------

667b274 Added unit test for bug when calling getGlobals() before addGlobal() on Twig_Environment.

Discussion
----------

Bug when calling getGlobals() before addGlobal() on Twig_Environment.

There seems to be an issue when calling getGlobals() before addGlobal(), the globals wont get updated. It doesn't seem to matter if the global existed before the call to getGlobals(). An update of the globals can be forced by calling an additional getGlobals() after the addGlobal() call.

I believe the problem has something to do with runtimeInitialized/extensionInitialized being set to true during rendering, but globals don't get updated during that phase.

Not sure how to fix it so I'm just sending you a unit test showcasing the bug.

framewr/Twig,gencer/Twig,markstory/Twig,nicolas-grekas/Twig,derickr/Twig,Tobion/Twig,Tobion/Twig,nicolas-grekas/Twig,twigphp/Twig,peterkokot/Twig,hhamon/Twig,jamessingizi/Twig,fsw/Twig,markstory/Twig,hhamon/Twig,twigphp/Twig,moltin/Twig,iKwinto/Twig,dkarvounaris/Twig,robregonm/Twig,peterkokot/Twig,robregonm/Twig,jamessingizi/Twig,bocharsky-bw/Twig,iKwinto/Twig,gamernetwork/Twig,dkarvounaris/Twig,framewr/Twig,jamessingizi/Twig,loi-chuanoi/Twig,hason/Twig,nicolas-grekas/Twig,craue/Twig,bocharsky-bw/Twig,moltin/Twig,apishka/templater,znerol/Twig,gamernetwork/Twig,Tobion/Twig,Rvanlaak/Twig,nicolas-grekas/Twig,bocharsky-bw/Twig,apishka/templater,fsw/Twig,nicolas-grekas/Twig,huang53798584/Twig,phansys/Twig,Rvanlaak/Twig,moufmouf/Twig,moltin/Twig,iKwinto/Twig,znerol/Twig,hason/Twig,gamernetwork/Twig,gencer/Twig,moufmouf/Twig,hhamon/Twig,derickr/Twig,robregonm/Twig,phansys/Twig,huang53798584/Twig,znerol/Twig,Rvanlaak/Twig,craue/Twig,dkarvounaris/Twig,twigphp/Twig,derickr/Twig,moufmouf/Twig,hason/Twig,framewr/Twig,fsw/Twig,huang53798584/Twig