1

FOSUserBundle を使用する symfony CMF プロジェクト内に新しいバンドルを作成しようとしています。私は symfony2 の経験がありますが、cmf の使用は初めてです。

私が従った手順:

1) 以下のコマンドを使用して symfony CMF をインストールしました。

php composer.phar create-project symfony-cmf/standard-edition myproject/

2) 次に、典型的な Symfony2 バンドルを作成しました。Acme\MasterBundle

3) 次に、次の行を composer.json に追加し、ベンダーを更新しました。

"friendsofsymfony/user-bundle": "1.3.*@stable"

4)しかし、インストールした後は使用できません。元のエラー メッセージから、欠落しているサービスsecurity.contextがこの問題の原因であることは明らかです。(以下はプロジェクトの composer.josn ファイルです)

{
"name": "symfony-cmf/standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony CMF Standard Edition\" distribution",
"authors": [
    {
        "name": "Symfony CMF Community",
        "homepage": "https://github.com/symfony-cmf/SimpleCmsBundle/contributors"
    }
],
"autoload": {
    "psr-0": { "": "src/" }
},
"minimum-stability": "stable",
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "twig/extensions": "1.0.*",
    "symfony/monolog-bundle": "2.3.*",
    "symfony/assetic-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "symfony-cmf/symfony-cmf": "1.0.*",
    "symfony-cmf/simple-cms-bundle": "1.0.*",
    "symfony-cmf/create-bundle": "1.0.*",
    "jackalope/jackalope-doctrine-dbal": "1.0.*",
    "doctrine/doctrine-bundle": "1.2.*",
    "doctrine/data-fixtures": "1.0.*",
    "lunetics/locale-bundle": "2.2.*",
    "liip/doctrine-cache-bundle": "1.0.*",
    "incenteev/composer-parameter-handler": "~2.0",
    "liip/imagine-bundle": "~0.12",
    "wjzijderveld/check-bundles": "1.0.*@dev",
    "sensio/generator-bundle": "2.3.*@dev",
    "friendsofsymfony/user-bundle": "1.3.*@stable",
    "doctrine/orm": "2.4.*@stable"
},
"require-dev": {
    "liip/functional-test-bundle": "1.0.*"
},
"scripts": {
    "post-install-cmd": [
        "WillemJan\\CheckBundles\\Composer\\CheckBundles::postPackageUpdate",
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ],
    "post-update-cmd": [
        "WillemJan\\CheckBundles\\Composer\\CheckBundles::postPackageUpdate",
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "checkbundles-ignore": [
        "Liip\\FunctionalTestBundle\\LiipFunctionalTestBundle",
        "Sensio\\Bundle\\DistributionBundle\\SensioDistributionBundle",
        "Sonata\\BlockBundle\\SonataBlockBundle",
        "Symfony\\Cmf\\Bundle\\BlockBundle\\CmfBlockBundle"
    ],
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "1.0-dev"
    }
}
}

結論:

以下のコマンドを実行してみましたが、セキュリティがないことがわかりました。*サービスがリストされています。

app/console container:debug
app/console container:debug security.context

上記の最後のコマンドからのエラー I は次のとおりです。

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The service definition "security.context" does not exist.

symfony CMF プロジェクト内で security.context を有効にする方法を知りたいです。

助けてください!

4

1 に答える 1