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

John Small flow3.tiny69 at net-con.net
Wed Jun 13 23:19:25 CEST 2012


Hi,

have you tried to inject ObjectManagerInterface:

     /**
      * @FLOW3\Inject
      * @var \TYPO3\FLOW3\Object\ObjectManagerInterface
      */
     protected $objectManager;


then use

$this->objectManager->getContext()


is from ActionController ;)


kbye
John


Am 13.06.2012 22:56, schrieb Mario Rimann:
> Hi
>
> 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.
>
> Cheers,
> Mario
>



More information about the FLOW3-general mailing list