尝试在symfony2中创建包时出错

时间:2014-04-13 21:10:25

标签: php symfony composer-php

我已经安装了symfony2,我确保应用程序已正确安装,我正在尝试为我的项目创建一个包,我似乎收到此消息,我已手动编辑composer.json并添加了正确的包到文件:

  

生成捆绑代码:OK
  检查捆绑包是否已自动加载:FAILED
  确认内核的自动更新[是]?是
  在内核中启用bundle:OK
  确认自动更新路由[是]?是
  导入捆绑包路由资源:确定

我确保编曲器已正确配置,我已从appkernel.php和routing.yml中删除了以前的命名空间,我们将非常感谢任何帮助。

这是我的composer.json文件:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {
            "Acme": "src/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"

    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

1 个答案:

答案 0 :(得分:0)

我在生成第一个包时也遇到了同样的问题。我做了以下事情: 1.确保在生成捆绑包之前安装了Composer。 2.如果在生成捆绑包时出现相同的失败消息,则在终端中在项目目录$ sudo composer dumpautoload -o中键入此消息。 这将运行您的应用程序。