0

http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.htmlの指示に従いますが、実行しようとすると Mongo サーバーが実行されます。

php app/console generate:bundle --namespace=Acme/StoreBundle

私は得る

Class 'Doctrine\Common\Persistence\Mapping\Driver\FileDriver' not found in /Users/username/Sites/myapp/vendor/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php on line 37

私の parameters.ini ファイルに何か問題があるのではないかと考えていますが、まだ MYSQL について言及していますが、上記のリンクではそれについて何も言及されていません。

[parameters]
    database_driver="pdo_mysql"
    database_host="localhost"
    database_port=""
    database_name="somedb"
    database_user="root"
    database_password="mypassword"
    mailer_transport="smtp"
    mailer_host="localhost"
    mailer_user=""
    mailer_password=""
    locale="en"
    secret="093faacf47bcdcdcdcdcdc9d152fc8b"

私は何を間違っていますか?

アップデート:

Doctrine Common をダウンロードしました。これが私の registerNameSpaces 関数です。

$loader->registerNamespaces(array(
    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    'Sensio'           => __DIR__.'/../vendor/bundles',
    'JMS'              => __DIR__.'/../vendor/bundles',
    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
    'Doctrine\\ODM\\MongoDB'    => __DIR__.'/../vendor/doctrine-mongodb-odm/lib',
    'Doctrine\\MongoDB'         => __DIR__.'/../vendor/doctrine-mongodb/lib',
    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
    'Monolog'          => __DIR__.'/../vendor/monolog/src',
    'Assetic'          => __DIR__.'/../vendor/assetic/src',
    'Metadata'         => __DIR__.'/../vendor/metadata/src',
    'FOS'              => __DIR__.'/../vendor/bundles',
    'FOS\\Rest'        => __DIR__.'/../vendor/fos',
    'JMS'              => __DIR__.'/../vendor/bundles',
));

私の deps ファイル:

[symfony]
    git=http://github.com/symfony/symfony.git
    version=origin/2.0

[twig]
    git=http://github.com/fabpot/Twig.git
    version=v1.8.2

[monolog]
    git=http://github.com/Seldaek/monolog.git
    version=1.0.2

[doctrine-common]
    git=http://github.com/doctrine/common.git
    version=2.1.4

[doctrine-dbal]
    git=http://github.com/doctrine/dbal.git
    version=2.1.7

[doctrine]
    git=http://github.com/doctrine/doctrine2.git
    version=2.1.7

[swiftmailer]
    git=http://github.com/swiftmailer/swiftmailer.git
    version=v4.2.0

[assetic]
    git=http://github.com/kriswallsmith/assetic.git
    version=v1.0.3

[twig-extensions]
    git=http://github.com/fabpot/Twig-extensions.git

[metadata]
    git=http://github.com/schmittjoh/metadata.git
    version=1.0.0

[SensioFrameworkExtraBundle]
    git=http://github.com/sensio/SensioFrameworkExtraBundle.git
    target=/bundles/Sensio/Bundle/FrameworkExtraBundle
    version=origin/2.0

[JMSSecurityExtraBundle]
    git=http://github.com/schmittjoh/JMSSecurityExtraBundle.git
    target=/bundles/JMS/SecurityExtraBundle
    version=origin/1.0.x

[SensioDistributionBundle]
    git=http://github.com/sensio/SensioDistributionBundle.git
    target=/bundles/Sensio/Bundle/DistributionBundle
    version=origin/2.0

[SensioGeneratorBundle]
    git=http://github.com/sensio/SensioGeneratorBundle.git
    target=/bundles/Sensio/Bundle/GeneratorBundle
    version=origin/2.0

[AsseticBundle]
    git=http://github.com/symfony/AsseticBundle.git
    target=/bundles/Symfony/Bundle/AsseticBundle
    version=origin/2.0


[FOSUserBundle]
    git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
    target=bundles/FOS/UserBundle
    version=1.2.0

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest

[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle

[JMSSerializerBundle]
    git=git://github.com/schmittjoh/JMSSerializerBundle.git
    target=bundles/JMS/SerializerBundle


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

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

[DoctrineMongoDBBundle]
    git=http://github.com/doctrine/DoctrineMongoDBBundle.git
    target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
    version=origin/2.0

また、マッピングの下にドライバー フォルダーが表示されません。php bin/vendors install --reinstall bu を実行しましたが、それでも役に立ちません。

4

3 に答える 3

2

DBAL、Common、ORM の 3 つを更新する必要があります。3体同時発売です。したがって、3 にはバージョン 2.2 を使用する必要があります。

ここにブログ投稿があります http://www.doctrine-project.org/blog/doctrine-2-2-final.html

これが役に立てば幸いです。

于 2012-07-30T04:14:52.360 に答える
1

Doctrine MongoDB ODMは最近、バージョン2.2以降に存在するDoctrine CommonのマッピングAPIを利用するようにリファクタリングされました(PRの#350および#370を参照)。次に、バンドルの2.0ブランチとマスターブランチの両方が更新されました(PR #124)。

depsファイルに基づいて、必要なクラスが含まれていないDoctrineCommon2.1.xを使用しています。Commonを2.2にバンプすることができます。これはSymfony2.0と互換性があるはずです。または、これらのPRがマージされる前に、ODMとバンドルを以前のコミットハッシュにロックすることができます。Composerを使用していない場合でも、各リポジトリ内のファイルをチェックするcomposer.jsonことは、これらの依存関係を追跡するための良い方法です。うまくいけば、Mongo ODMリポジトリにタグがすぐに追加され、将来この頭痛の種が軽減されるはずです。

于 2012-07-30T01:58:32.497 に答える
0

Doctrine Commonがインストールされていないか、オートローダーに登録されていません。インストールするか(リンク:https ://github.com/doctrine/common )、sf2標準版を再ダウンロードします。

于 2012-07-30T00:24:57.683 に答える