[TYPO3-50-general] Deactivate packages in certain contexts

Bastian Waidelich bastian at typo3.org
Fri Oct 26 14:57:48 CEST 2012


Hello all,

I think it's a valid use case to have some packages only available in 
certain contexts.
For a concrete example I'd like to have a new context 
"Production/Debugging" that loads the "Debug.Toolbar" package 
("Sandstorm.PhpProfiler" & "Sandstorm.Plumber" respectively) but they 
shouldn't be active in the regular Production context.

Do you think it makes sense to introduce such feature (to be able to 
install packages only in a certain context) or do you think it would be 
too complex usage and/or implementation wise?


For a compromise I tried to disable the packages above with some special 
settings. Plumber comes with a setting "enableProfiling" so I tried to 
implement something similar in Debug.Toolbar.
Enabling the AOP aspects based on some setting turns out to be really 
easy in Flow. One can just replace annotations as follows:

@Flow\After("method(TYPO3\Flow\Security\Policy\PolicyService->getPrivilegesForJoinPoint(*))")

@Flow\After("setting(Debug.Toolbar.enable) && 
method(TYPO3\Flow\Security\Policy\PolicyService->getPrivilegesForJoinPoint(*))")

But then the custom request handler is still active and will be used and 
I did not find a way to disable that with some setting (because the 
configuration manager is not yet fully initialized when 
RequestHandler::canHandleRequest() is called..
Does anybody have an idea here?

Best


-- 
Bastian Waidelich
TYPO3 Core Team Member

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


More information about the TYPO3-project-5_0-general mailing list