Can't register Ratchet bundle from private git in AppKernel

33 views Asked by At

So a little context: I have an old project in symfony 2.8 and php 5.6 Composer have been abandonned by the previous developper and i'm trying to make it work again. I had a bunch of conflicting versions, url to previous svn, i've updated some package ect.

Now everything is installing fine but the clear cache from the post-update-cmd crash with this error :

PHP Fatal error:  Class 'P2\Bundle\RatchetBundle\P2RatchetBundle' not found in /Project/app/AppKernel.php on line 19

I'm loading 2 vendor from private gitlab, both are installed but no matter which one i try to call in registerBundles()

I can't find the real cause of this error.

So here the code :

composer.json :

     ...

    "repositories" : [
        {
            "type": "package",
            "package": {
                "name": "p2/ratchet-bundle",
                "version": "dev-master",
                "type": "package",
                "source": {
                    "url": "https://git-dev.my-company.fr/my-company-bundles/ratchet-bundle.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }

     ...

    "require" : {
             "p2/ratchet-bundle" : "dev-master",
             ...
        }


AppKernel.php

class AppKernel extends Kernel {

    public function registerBundles() {
        $bundles = array(

           ...

        new P2\Bundle\RatchetBundle\P2RatchetBundle(), 

           ...

        );
        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader) {
        $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml');
    }
    
}

There is no problem to get the bundle from the gitlab repo. It appears into the installed.json and installed.php of composer vendor

This bundle is installed in Project/vendor/p2/ratchet-bundle/P2RatchetBundle.php

namespace P2\Bundle\RatchetBundle;

/**
 * Class P2RatchetBundle
 * @package P2\Bundle\RatchetBundle
 */
class P2RatchetBundle extends Bundle
{

At the moment, i can't use the console or load any page with this new setup. It's probably just a small thing i missed but i can't figure what. If you want some more information just ask

0

There are 0 answers