Dispatcher rework¶
This feature is part of Extbase 1.3 , included in TYPO3 4.5 LTS .
In the last versions of Extbase (< 1.3.x), the Dispatcher (Tx_Extbase_Dispatcher) was the main entry point to Extbase.
However, as we did not have Dependency Injection at that point, it became really complex and did lots of things which
it should not do in the first place. That's why we greatly improved that part. Now, any Extbase extension is invoked using
the Tx_Extbase_Core_Bootstrap. Additionally, the TypoScript used for the registration of any Extbase extension has
been cleaned up and adjusted:
lib.foo = USER
lib.foo {
userFunc = tx_extbase_core_bootstrap->run
extensionName = YourExtension
pluginName = YourPlugin
}
Additionally, you can also override the list of Switchable Controller Actions through TypoScript:
lib.foo = USER
lib.foo {
userFunc = tx_extbase_core_bootstrap->run
extensionName = YourExtension
pluginName = YourPlugin
switchableControllerActions {
Standard {
1 = action2
2 = action3
}
}
}
Of course you can do the above in PHP as well:
1 $bootstrap = t3lib_div::makeInstance('Tx_Extbase_Core_Bootstrap'); 2 $configuration = array( 3 'extensionName' => 'YourExtension', 4 'pluginName' => 'YourPlugin', 5 'switchableControllerActions' => array( 6 'Standard' => array('action2', 'action3') 7 ), 8 ); 9 $bootstrap->run('', $configuration);
You can't configure whether an action should be cached or not here to avoid complexity. Please use the API methodTx_Extbase_Utility_Extension::configurePlugin() to define non-cacheable actions.
NOTE: If you manually defined the above snippet, notice that there is a change in there that is not backwards
compatible. But you did that at your own risk, as that was never public API.
If you used Tx_Extbase_Dispatcher before in your own code, it should still work, but it is deprecated:
OLD: Tx_Extbase_Dispatcher::getConfigurationManager()
NEW: inject Tx_Extbase_Configuration_ConfigurationManagerInterface into your class
see ConfigurationManager refactoring
OLD: Tx_Extbase_Dispatcher::getPersistenceManager()
NEW: inject Tx_Extbase_Persistence_ManagerInterface into your class
OLD: Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration()
NEW: inject Tx_Extbase_Configuration_ConfigurationManagerInterface into your class,
and call $configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
on the ConfigurationManager.
Please note that the Configuration Manager is still no public API, and its method signature has also changed.
Here is a little tutorial on how to use this in TypoScript-Context