TYPO3和MySQL触发器
在扩展名的ext_tables.sql文件中,我可以定义要添加到数据库中的新表/字段TYPO3和MySQL触发器,mysql,typo3,Mysql,Typo3,在扩展名的ext_tables.sql文件中,我可以定义要添加到数据库中的新表/字段 使用TYPO3是否也可以将触发器(MySQL)添加到数据库中?不通过ext\u tables.sql 您可以使用扩展管理器信号槽,在安装扩展后在那里执行查询 扩展名的ext\u localconf.php: call_user_func(function($extensionKey) { $signalSlotDispatcher = \TYPO3\CMS\Core\Utility\Genera
使用TYPO3是否也可以将触发器(MySQL)添加到数据库中?不通过
ext\u tables.sql
您可以使用扩展管理器信号槽,在安装扩展后在那里执行查询
扩展名的ext\u localconf.php:
call_user_func(function($extensionKey) {
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService::class,
'hasInstalledExtensions',
function($keyOfInstalledExtension) use ($extensionKey) {
if ($extensionKey !== $keyOfInstalledExtension) {
return;
}
\Vendor\MyExt\Hooks\ExtensionManager::postInstallExtension();
}
);
}
}, $_EXTKEY);
谢谢,但当您处理stage/dev环境时,安装和卸载扩展不是很方便,您需要考虑每次创建新的安装。