Class 用于未自动加载的命令控制器
Class for command controller not put to autoload
我安装了一个基于 composer 的 TYPO3 7.6,想用命令控制器创建一个 Extbase 扩展。
控制器已在 ext_localconf.php
中注册,但未找到命令控制器,因为在 public function getAvailableCommands()
中的 typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php
中未找到 class
命名空间也已设置:namespace Foo\FooT3monitoringNotification\Command;
class 在这里 Classes/Command/NotificationCommandController.php
.
我已经清除了所有 TYPO3 缓存并做了 composer dump-autoload
。任何想法,我错过了什么或者我可以做些什么来找出为什么我的 class 没有自动加载?
由于您新创建的扩展不是通过 composer 安装的,因此您需要定义查找 类 的位置。因此你需要添加一个自动加载部分到你的根 composer.json (这意味着不在你的扩展中,而是在你的 TYPO3 分发根文件夹中):
"autoload": {
"psr-4": {
"Foo\FooT3monitoringNotification\": "web/typo3conf/ext/foo_t3monitoring_notification/Classes"
}
}
我安装了一个基于 composer 的 TYPO3 7.6,想用命令控制器创建一个 Extbase 扩展。
控制器已在 ext_localconf.php
中注册,但未找到命令控制器,因为在 public function getAvailableCommands()
typo3/sysext/extbase/Classes/Mvc/Cli/CommandManager.php
中未找到 class
命名空间也已设置:namespace Foo\FooT3monitoringNotification\Command;
class 在这里 Classes/Command/NotificationCommandController.php
.
我已经清除了所有 TYPO3 缓存并做了 composer dump-autoload
。任何想法,我错过了什么或者我可以做些什么来找出为什么我的 class 没有自动加载?
由于您新创建的扩展不是通过 composer 安装的,因此您需要定义查找 类 的位置。因此你需要添加一个自动加载部分到你的根 composer.json (这意味着不在你的扩展中,而是在你的 TYPO3 分发根文件夹中):
"autoload": {
"psr-4": {
"Foo\FooT3monitoringNotification\": "web/typo3conf/ext/foo_t3monitoring_notification/Classes"
}
}