Skip to content

v2.0-dev and Symfony 3.4 non Flex #62

@arnaudgoulpeau

Description

@arnaudgoulpeau

Hi, thanks for your work !

I managed to make your bundle work under a Sf 3.4 non flex project.

I don't know if there are more to do, because it seams a bit hacky but here is what I did :

  • In every bundle, i.e AdminBundle.php at the bundle root, add a toString method
  • Example :
<?php

namespace AdminBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AdminBundle extends Bundle
{
    public function __toString()
    {
        return $this->getPath();
    }
}
  • The key point is to give the path, so that the generated classes are created at the right place. With $this->getName(), folders and classes are located at the project root, same level as 'src'.

I said hacky because of the __toString method.

  • Maybe updating the DoctrineFixtureGenerator::generate line 78 could do the trick, since $bundle is an object and not a string, but I didn't dig that much on the SYMFONY_4_BUNDLE_ALIAS constants deep meaning.

Maybe this 'hack' could end in the documentation, because its a pity not to benefits your work on many-to-many snapshot functionnality.

Again thank you for your work !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions