Symfony软件包错误NotFoundException:尝试从命名空间“ Toiba \ FullCalendarBundle”

时间:2019-10-01 13:52:24

标签: php symfony fullcalendar bundle

我已经用php 7+和symfony 3.4编写了一个webapp,在开发模式下一切正常。

然后我尝试了以下命令:

  

composer install --no-dev

发生此错误:

  

[RuntimeException]执行以下命令时发生错误   ““ cache:clear --no-warmup”“命令:

     

致命错误:未被发现   Symfony \ Component \ Debug \ Exception \ ClassNotFoundException:尝试执行   从名称空间加载类“ FullCalendarBundle”   “ Toiba \ FullCalendarBundle”。您是否忘记了“使用”声明   另一个名称空间?在F:\ wamp64 \ www \ justdrive \ app \ AppKernel.php:15

我尝试修改此内容:

"psr-4": {
    "AppBundle\\": "src/AppBundle"
},

对此:

"psr-4": {
    "": "src/"
},

然后执行以下命令:

  

composer dump-autoload

但是我提到的第一个命令之后仍然出现相同的错误。

这是我的作曲家.lock中的捆绑包

{
            "name": "toiba/fullcalendar-bundle",
            "version": "v6.2.4",
            "source": {
                "type": "git",
                "url": "https://github.com/toiba/FullCalendarBundle.git",
                "reference": "d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/toiba/FullCalendarBundle/zipball/d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74",
                "reference": "d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74",
                "shasum": ""
            },
            "require": {
                "php": "^5.5|^7.0",
                "symfony/framework-bundle": "^3.4|^4.0"
            },
            "require-dev": {
                "phpspec/phpspec": "^2.5"
            },
            "type": "symfony-bundle",
            "autoload": {
                "psr-4": {
                    "Toiba\\FullCalendarBundle\\": ""
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Rebeca Mora Anca",
                    "email": "anca.rebeca@gmail.com",
                    "role": "Developer"
                },
                {
                    "name": "Théo Attali",
                    "email": "theoattali@gmail.com",
                    "role": "Developer"
                }
            ],
            "description": "Symfony integration of FullCalendar.js library. Events can be stored with Doctrine, MongoDB, CouchDB and others",
            "homepage": "https://github.com/toiba/FullCalendarBundle",
            "keywords": [
                "calendar",
                "fullcalendar",
                "jquery calendar",
                "symfony calendar"
            ],
            "abandoned": "https://github.com/tattali/CalendarBundle",
            "time": "2018-08-09T18:06:32+00:00"
        }

这是appkernel.php中的软件包

public function registerBundles()
    {
        $bundles = [
...
new Toiba\FullCalendarBundle\FullCalendarBundle(),
...
];

你能帮我吗?

1 个答案:

答案 0 :(得分:1)

感谢@Cerad和@Frankich,我能够使它工作。

我必须执行

  

撰写者需要toiba / fullcalendar-bundle

先正确安装,然后

  

composer install --no-dev

命令很好地唤醒了!

非常感谢您。