首页 文章

在AppKernel中找不到symfony 2.7基本包类

提问于
浏览
0

我通过生成器命令创建了一个symfony 2.7软件包,它是在src / Bundle / bundlename下生成的,但是我想通过composer使用这个软件包能够在另一个项目中使用它我移动了bundle文件然后创建了composer . json为捆绑

{
"name" : "extremesolution/payment-handler-vodafone-bundle",
"type" : "symfony-bundle",
"description": "Vodafone Redpoints Payment Handler Bundle",
"authors": [
    {
        "name": "Hazem Taha",
        "email": "hazem.taha@extremesolution.com"
    }
],
"require" : {
    "php": "^5.5"
},

"require-dev": {
    "phpunit/phpunit": "~3.7"
},

"autoload" : {
    "psr-4" : {
        "Extremesolution\\Bundle\\ExtremesolutionPaymentHandlerVodafoneBundle\\" : ""
    }
  }
}

并将其推送到bitbucket私有仓库并在我的项目composer.json中需要捆绑包并提供存储库url并在AppKernel.php中注册捆绑包

new Extremesolution \ Bundle \ PaymentHandlerVodafoneBundle \ ExtremesolutionPaymentHandlerVodafoneBundle()

但每当我运行作曲家更新我得到

[RuntimeException]执行“'cache:clear --no-warmup'”命令时发生错误:致命错误:在/ home / kan / symfony_试验/付款中找不到类'Extremesolution \ Bundle \ PaymentHandlerVodafoneBundle \ ExtremesolutionPaymentHandlerVodafoneBundle'第25行上的example / app / AppKernel.php PHP致命错误:第25行的/ home / kan / sym fony_trials / payment-example / app / AppKernel.php中找不到类'Extremesolution \ Bundle \ PaymentHandlerVodafoneBundle \ ExtremesolutionPaymentHandlerVodafoneBundle' .

我通过phpbrew,作曲家版本1.2.1和symfony 2.7使用php版本5.5.38

我错过了什么吗?是否有通过composer使用的捆绑包的自定义配置?

2 回答

  • 0

    composer.json 文件中,您将PSR-4名称空间前缀配置为 Extremesolution\\Bundle\\ExtremesolutionPaymentHandlerVodafoneBundle\\ . 但是,根据错误消息,您正在尝试加载类 Extremesolution\Bundle\PaymentHandlerVodafoneBundle\ExtremesolutionPaymentHandlerVodafoneBundle (注意缺少的 Extremesolution 部分) .

  • 0

    您的问题可能来自您的软件包位于私有存储库的事实 . 我建议你将可见性改为公开,并将其发布在packagist上 .

    如果由于某种原因你必须将其保密,请查看how to handle private packages上的作曲家文档 .

    希望它可以帮助,

    问候

相关问题