[FEATURE] Introduce methods to detect TYPO3_MODE properly
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Sun, 17 Mar 2013 21:31:08 +0000 (22:31 +0100)
committerAlexander Schnitzler <typo3@alexanderschnitzler.de>
Mon, 18 Mar 2013 08:19:40 +0000 (09:19 +0100)
commit47fc4fbba71095d0ba3eac404359866c0782254e
treef232e19d7634c7926a40a8f6a21b89390f9e28f8
parentacd4001ca7e70032095bb69dbc5a75794d78cffa
[FEATURE] Introduce methods to detect TYPO3_MODE properly

Currently a lot of conditions exist that directly
check for TYPO3_MODE to be "FE" or "BE". When it
comes to unit test this is pretty bad as constants
cannot be mocked at all.

Therefore this patch introduces two methods in the
ExtensionService to detect if the plugin is running
in frontend or backend mode.

Releases: 6.1
Resolves: #46391
Change-Id: I7367cda467ac2a421e0f8d6d25dd2209f939b99b
Reviewed-on: https://review.typo3.org/18995
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Alexander Schnitzler
Tested-by: Alexander Schnitzler
typo3/sysext/extbase/Classes/Service/EnvironmentService.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Service/ExtensionService.php