Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony 将TYPO3 Extbase任务迁移到Symphony命令_Symfony_Typo3_Extbase_Typo3 10.x - Fatal编程技术网

Symfony 将TYPO3 Extbase任务迁移到Symphony命令

Symfony 将TYPO3 Extbase任务迁移到Symphony命令,symfony,typo3,extbase,typo3-10.x,Symfony,Typo3,Extbase,Typo3 10.x,我正在尝试将扩展迁移到TYPO3 10 LTS,但我在迁移调度程序任务时遇到了麻烦,该任务从社交提要更新TYPO3数据 我学习了如何在Services.yaml文件中注册Symfony控制台命令,以便执行该命令 问题在于pb_社交扩展依赖于Extbase,与实际的updateFeedDataCommand命令相同 因此,我尝试以Symfony样式创建一个新命令,并在其方法execute()中实例化: $objectManager = GeneralUtility::makeInstance(Ob

我正在尝试将扩展迁移到TYPO3 10 LTS,但我在迁移调度程序任务时遇到了麻烦,该任务从社交提要更新TYPO3数据

我学习了如何在Services.yaml文件中注册Symfony控制台命令,以便执行该命令

问题在于pb_社交扩展依赖于Extbase,与实际的
updateFeedDataCommand
命令相同

因此,我尝试以Symfony样式创建一个新命令,并在其方法
execute()
中实例化:

$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var PBSocialCommandController $controller */
$controller = $objectManager->get(PBSocialCommandController::class);
我已经更新了pb_social methods的属性,以使用新的
@TYPO3\CMS\Extbase\Annotation\Inject
,但注入似乎仍然不起作用

例如:

/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @TYPO3\CMS\Extbase\Annotation\Inject
*/
protected $configurationManager;
$this->configurationManager在使用时为空

有什么问题吗?

使用


你真的需要控制器吗?为什么不将所需的代码移动到服务类并实例化它呢?@ThomasLöffler如果我错了,请纠正我,但这应该与注入问题无关。即使我直接从命令的execute()方法调用FeedSyncService,当它与
$FeedSyncService=GeneralUtility::makeInstance实例化时(FeedSyncService::class);
实例化了
AbstractBaseService
,但其注入的
$configurationManager
属性未初始化,因此引发异常。即使我将FeedSyncService实例化为
$objectManager=GeneralUtility::makeInstance(objectManager::class);$feedSyncService=$objectManager->get(feedSyncService::class);
…同样的问题。
/**
 * @param ConfigurationManager $configurationManager
 */
public function injectConfigurationManager(ConfigurationManager $configurationManager)
{
    $this->configurationManager = $configurationManager;
}