0

当我将 sonata-admin 包安装到我的 symfony 项目中时。我已将我的 yml 文件配置如下:

sonata_block:
    default_contexts: [cms]
    blocks:
        sonata.admin.block.admin_list:
            contexts:   [admin]
        sonata.block.service.text:
        sonata.block.service.action:
        sonata.block.service.rss:

我有 deps 文件如下:

[SonataAdminBundle]
    git=git://github.com/sonata-project/SonataAdminBundle.git
    target=/bundles/Sonata/AdminBundle
    version=origin/2.0

我收到以下错误

安装/更新 SonataAdminBundle a25d8c0e084ed4a175b89a93e93bdea2cf5563ab 致命:无法查找 github.com(端口 9418)(不知道这样的主机。)

  [Symfony\Component\Config\Exception\FileLoaderLoadException]

  Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa
mp\www\Symfony\app/config/config_dev.yml".




  [InvalidArgumentException]




  There is no extension able to load the configuration for "sonata_block" (in C:
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task"
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution"











  [Symfony\Component\Config\Exception\FileLoaderLoadException]

  Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa
mp\www\Symfony\app/config/config_dev.yml".











  [InvalidArgumentException]




  There is no extension able to load the configuration for "sonata_block" (in C:
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task"
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution"

在这种情况下我该怎么办

4

1 回答 1

1

当您尝试安装您的供应商时,它似乎无法使用 git: 协议与 github.com 联系,这就是为什么它说它无法使用 9418 端口进行联系,这是 git 协议使用的端口。这可能是由于某些防火墙阻止了此端口或任何类似原因。由于它无法下载 SonataAdmin 代码,这就是您收到所有其他错误的原因。

您可以做的是将 git: 协议替换为 http: 协议,该协议也可用于访问 github。因此,只需将您的部门更改为:

[SonataAdminBundle]
    git=http://github.com/sonata-project/SonataAdminBundle.git
    target=/bundles/Sonata/AdminBundle
    version=origin/2.0

它应该可以工作

于 2012-08-01T12:08:42.250 回答