问题描述
我正在尝试将扩展名pb_social迁移到TYPO3 10 LTS,但是我陷入了从社交订阅源更新TYPO3数据的调度程序任务的迁移。
我学习了如何在Services.yaml文件中注册Symfony控制台命令,以便执行该命令。
问题在于pb_social扩展名与其实际updateFeedDataCommand
命令一样依赖于Extbase。
因此,我尝试以Symfony样式及其示例方法execute()
创建一个新命令:
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var PBSocialCommandController $controller */
$controller = $objectManager->get(PBSocialCommandController::class);
我已经更新了pb_social方法的属性以使用新的@TYPO3\CMS\Extbase\Annotation\Inject
,但是注入似乎仍然无效。
例如与:
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @TYPO3\CMS\Extbase\Annotation\Inject
*/
protected $configurationManager;
$ this-> configurationManager在使用时为空。
可能是什么问题?
解决方法
保存
/**
* @param ConfigurationManager $configurationManager
*/
public function injectConfigurationManager(ConfigurationManager $configurationManager)
{
$this->configurationManager = $configurationManager;
}