0
votes

I have coded a webapp in php 7+ and symfony 3.4, everything works fine in dev mode.

Then I tried this command :

composer install --no-dev

and this error occured :

[RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command:

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "FullCalendarBundle" from namespace "Toiba\FullCalendarBundle". Did you forget a "use" statement for another namespace? in F:\wamp64\www\justdrive\app\AppKernel.php:15

I have tried to modify this :

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

to this :

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

and then execute this command :

composer dump-autoload

but I still get the same error after the first command I mentionned.

here is the bundle in my composer .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"
        }

Here is the bundle in appkernel.php

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

Can you please help me?

1
I do not know much about composer and git repo so i'm probably wrong, but is it normal to try to install a read-only repository ?Frankich
Did you copy/paste the missing class statement or type it out? The reason I ask is that "FullCalend arBundle" has a space in it. In any event, double check composer.json and verify that the calendar bundle did not somehow end up in the dev section.Cerad
@Frankich I don't know I followed the guide here: packagist.org/packages/toiba/fullcalendar-bundleMatt Zdj
@Cerad the emptyspace was a copy/paste error, there is no emptyspace in the original error. I don't have any reference of Fullcalendar in my composer.json, not even in the dev sectionMatt Zdj
@MattZdj So it sounds like composer was not used to originally install the bundle. Maybe a zip download from somewhere. Either use "composer require toiba/fullcalendar-bundle" or, since it is depreciated, go with a maintained package.Cerad

1 Answers

1
votes

Thanks to @Cerad and @Frankich I was able to get it working.

I had to execute

composer require toiba/fullcalendar-bundle

to install it proprely and then the

composer install --no-dev

command woked nicely!

Thank you very much.