polidog lab++

Blog
symfony2.3でdoctrine-fixtures-bundleを入れる

symfony2.3でdoctrine-fixtures-bundleを入れる

Jun 27, 2013 | tech | doctrine2 fixture php symfony2

symfony2.3が6/10にリリースされていましたね。
ちなみにphp5.5.0もリリースされていますよー。今週末に色々と試してみようと思っている僕です。

さてさて、Symfony2使うときに必ずと言っていい程入れるバンドルの一つにdoctrine-fixtures-bundleがあります。
僕の記憶が正しければ、2.2までは以下をcomposer.jsonに追加すれば行けたはず

"require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",

    "gedmo/doctrine-extensions": "dev-master",
    "stof/doctrine-extensions-bundle": "dev-master"
    },

ただ2.3だとなぜか以下のようなエラーが。。。

$  composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/doctrine-fixtures-bundle dev-master -> satisfiable by doctrine/doctrine-fixtures-bundle[dev-master].
    - doctrine/doctrine-fixtures-bundle dev-master requires doctrine/data-fixtures * -> no matching package found.
  Problem 2
    - doctrine/doctrine-fixtures-bundle dev-master requires doctrine/data-fixtures * -> no matching package found.
    - symfony/framework-standard-edition 2.3.x-dev requires doctrine/doctrine-fixtures-bundle dev-master -> satisfiable by doctrine/doctrine-fixtures-bundle[dev-master].
    - Installation request for symfony/framework-standard-edition 2.3.x-dev -> satisfiable by symfony/framework-standard-edition[2.3.x-dev].

なんかdoctrine/data-fixturesもcomposerで指定しろよってことっぽいので記載してあげます。

"require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "doctrine/data-fixtures": "1.0.*@dev",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",

    "gedmo/doctrine-extensions": "dev-master",
    "stof/doctrine-extensions-bundle": "dev-master"
    },

これで無事インストールできましたー!

comments powered by Disqus

関連記事

© 2017 polidog lab++