Actions
Bug #23877
closedAdd DB structure update pre-processing hook in EM
Start date:
2010-10-30
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Extension Manager lacks a way to perform actions prior to modify the database structure (create new tables or add additional fields in existing ones) when installing an extension.
This would be very handy for DBAL to let user update mapping definition from within TYPO3 without the need to first manually edit typo3conf/localconf.php.
Example of use:
(localconf.php of your extension):
$TYPO3_CONF_VARS['SC_OPTIONS']['typo3/mod/tools/em/index.php']['checkDBupdates'][] = t3lib_extMgm::extPath($_EXTKEY) . 'test.php:user_test';
(typo3conf/ext/your-ext/test.php)
class user_test implements em_index_checkDBupdatesHook {
public function preprocessDBupdates($extKey, array $extInfo, array $updateStatements, SC_mod_tools_em_index $parent) {
$output = '';
$options = t3lib_div::_GP('user_test');
if (is_array($options) && $options['foo'] == 1) {
// Perform some action
} else {
//t3lib_div::debug($updateStatements, 'statements');
// Show actions that should be performed
$output .= '<input type="checkbox" name="user_test[foo]" value="1" /> Pre-processing action';
}
return $output;
}
}
?>
(issue imported from #M16177)
Files
Actions