Search code examples
phpsymfonydoctrine-ormdoctrinedoctrine-extensions

How to install doctrine extensions


While learning Symfony2 i can't find any resources that will tell me what to do to install doctrine extensions library. i know that I should add

new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

to my AppKernel.php, but what about composer? i always use it when i install eg. DoctrineFixtures, but i dont know what exactly i need to add there in this case. I tried

"gedmo/doctrine-extensions" : "master-dev",

But php composer.phar update returns php FatalError:

PHP Fatal error:  Class 'Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle' not found in /path/to/my/symfony/project/app/AppKernel.php on line 20
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

Solution

  • You should install "stof/doctrine-extensions-bundle": "1.1.0" via composer if you want to use that bundle.

    gedmo/doctrine-extensions is PHP library, not symfony bundle

    When you wonder what to install, searching for a lib or bundle, just use the packagist.org

    https://packagist.org/search/?q=StofDoctrineExtensionsBundle