我可以'在symfony app内核中加载我的供应商

时间:2015-07-24 18:37:09

标签: json symfony github packagist vendor

我在github上创建了一个供应商,并在packagist中创建它,在composer中成功加载它,并完美地安装在我的vendor / company / nameBundle /中,但现在我需要将它加载到app / AppKernel.php上symfony,但是它还没有找到404,这个类不存在

在我的composer.json

"require": {
    "agazzi/rest-client-authenticator": "1.0.*"
}

这部分很好

我的packagist Bundle的composer.json

{
    "name" : "agazzi/rest-client-authenticator",
    "description" : "API restfull json authenticator client",
    "keywords": ["package", "composer"],
    "homepage": "http://v*****s.com/",
    "type": "library",
    "license": "MIT",
    "authors": [
        {
            "name": "W*****m R****t",
            "email": "w******.*****t@******.com",
            "homepage": "http://v*****s.com"
        }
    ],
    "support": {
          "email": "contact@packagist.org"
    },
    "autoload": {
        "psr-4": { "Agazzi\\RestClientAuthenticatorBundle\\": "" }
    }
}

和我的AppKernel.php

$bundles = array( 
    new Agazzi\RestClientAuthenticatorBundle\AgazziRestClientAuthenticatorBundle()
);

有什么想法吗?

此致

2 个答案:

答案 0 :(得分:0)

我不知道......但是我安装了symfony 2.3,在编辑器中添加了bundle,运行了composer update并在AppKernel中添加了一行,一切正常。

似乎其他事情是错误的。

向我们提供有关404错误的更多信息。

答案 1 :(得分:0)

可能Symfony会返回404,因为您没有这样的路线。 运行app / console并查看输出。如果没有错误,请确保您的包已加载。