Flukey
Flukey

Reputation: 6555

Installation of a symfony2 bundle (DoctrineCouchDBBundle)

I wish to install the bundle into my symfony project. However, I am coming across a few issues. Please accept my ignorance if the answer is trivial but I've tried searching for a solution but alas, I've found nothing.

In my deps file, I have:

[doctrine-couchdb]
  git=http://github.com/doctrine/couchdb-odm.git
[DoctrineCouchDBBundle]
  git=http://github.com/doctrine/DoctrineCouchDBBundle.git
  target=/bundles/Symfony/Bundle/DoctrineCouchDBBundle

I run the bin/vendors install command

In my autoload.php file I have:

'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',

I've registered the bundle:

new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle()

When I run php app/console I get the error:

Fatal error: Class 'Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle' not found in /var/www/symfony2.test/app/AppKernel.php on line 22

I've noticed that for MongoDB ODM you have:

[doctrine-mongodb]
    git=http://github.com/doctrine/mongodb.git

is there not a doctrine-couchdb repo? Have you used this bundle?

Upvotes: 5

Views: 3098

Answers (2)

isawk
isawk

Reputation: 436

I changed target to


    target= /bundles/Doctrine/Bundle/CouchDBBundle

so now looks like this


    [DoctrineCouchDBBundle]
      git=http://github.com/doctrine/DoctrineCouchDBBundle.git
      target=/bundles/Doctrine/Bundle/CouchDBBundle

because I noticed that name space for couchdb bundle is


    namespace Doctrine\Bundle\CouchDBBundle;

therefore adding


    new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle()

to AppKernel will fail, if installation location does not match namespace/class_name.

Detailed setup and configuration here DoctrineCouchDBBundle Git Hub Issue Log

For those that are new to Symfony 2 bundling architecture, you probably wonder what configuration keys are mandatory and available for bundles. Info can be obtained from:


    bundle_dir/bundle_name/.../configuration.php

Upvotes: 1

Inoryy
Inoryy

Reputation: 8425

Update :

1.) Check that you also have installed and autoloaded Doctrine\CouchDB

2.) in your git installation

target=/bundles/Symfony/Bundle/DoctrineCouchDBBundle should probably be

target=/bundles/Doctrine/Bundle/DoctrineCouchDBBundle (notice Symfony => Doctrine)

3.) Then change

'Doctrine' => __DIR__.'/../vendor/doctrine/lib',

to

'Doctrine' => array(__DIR__.'/../vendor/doctrine/lib', __DIR__.'/../vendor/bundles'),


Off the top of my head I'd assume either these things:

1.) Cache

2.) 'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib', should be above any higher level namespaces ('Doctrine', 'Doctrine\Common')

so it should look like this:

'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',
'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',

3.) some configuration missing in config.yml

Upvotes: 1

Related Questions