[FLOW3-general] How to determine the context in a command controller?

Robert Lemke robert at typo3.org
Thu Jun 14 02:39:40 CEST 2012


Hi Mario,

On 13.06.2012, at 16:56, Mario Rimann <mario.rimann at typo3.org> wrote:

> I'm building some lowlevel commands to prepare a defined set of dummy
> data during development (and another method for destroying that stuff
> again). How can I detect the context and exit as soon as the command
> controller is called from outside of the Development context?
> 
> It seems like $_ENV and $_SERVER don't contain any reference to the
> context and I couldn't find it in the request object yet.


the official way as of FLOW3 1.1 is using the getContext() method of the Bootstrap. Just inject the TYPO3\FLOW3\Core\Bootstrap into your controller and call that method.

Cheers,
Robert

-- 
Robert Lemke
Lead Developer TYPO3 Phoenix and FLOW3
Co-Founder TYPO3 Association

Blog: robertlemke.de/blog
Get involved: typo3.org – flow3.org





More information about the FLOW3-general mailing list