duanjue9889 2015-12-21 11:33
浏览 27

检测到symfony2中的服务的循环引用

After updating Symfony from 2.7.2 to 2.7.7 I get following error:

Circular reference detected for service "phoenix_content.renderservice", path: "phoenix_content.renderservice -> phoenix_content.twig.environment

Here is my services.yml file:

services:

##
# Dedicated Twig Environment
##
phoenix_content.twig.environment:
  class: Phoenix\Bundle\ContentBundle\Twig\Twig_Environment
  arguments: ["%kernel.debug%"]

phoenix_content.twig.phoenix_extension:
  class: Phoenix\Bundle\ContentBundle\Twig\Extension\PhoenixExtension
  arguments: ["@phoenix_content.pageModuleStorage", "@doctrine.orm.entity_manager", "@phoenix_content.renderDirective", "@phoenix_content.renderService"]
tags:
  - { name: phoenix_twig.extension }

phoenix_content.twig.loader_module:
  class: Phoenix\Bundle\ContentBundle\Twig\TwigLoaderModule
  arguments: []
  tags:
    - { name: phoenix_twig.loader }

phoenix_content.twig.compiler:
  class: Phoenix\Bundle\ContentBundle\Twig\Twig_Compiler
  arguments: [@phoenix_content.twig.environment]
  tags:
    - { name: phoenix_twig.compiler }

phoenix_content.twig.token_extractor:
  class: Phoenix\Bundle\ContentBundle\Twig\TokenExtractor
  arguments: ["@phoenix_content.twig.environment"]

phoenix_content.twig.template:
  class: Phoenix\Bundle\ContentBundle\Twig\Twig_Template
  arguments: ["@phoenix_content.twig.environment", "@phoenix_content.pageModuleStorage"]

##
# Factories
##
phoenix_content.element_factory:
  class: Phoenix\Bundle\ContentBundle\Element\ElementFactory
  lazy: true
  arguments: []

phoenix_content.connector_factory:
  class: Phoenix\Bundle\ContentBundle\Connector\ConnectorFactory
  lazy: true
  arguments: ["@phoenix_content.element_factory", "@doctrine.orm.entity_manager"]


##
# Connectors (for connector factory)
##
phoenix_content.connector.contentful:
  class: Phoenix\Bundle\ContentBundle\Connector\ContentfulConnector
  arguments: ["@phoenix_content.element_factory", "@debug.stopwatch", "@phoenix_content.connector_factory", "%contentful_connector_api_key%", "%contentful_connector_space_id%", "%contentful_connector_catalog_id%"]
  tags:
    -  { name: phoenix_content.connector }

phoenix_content.connector.cumulus:
  class: Phoenix\Bundle\ContentBundle\Connector\CumulusConnector
  arguments: ["@phoenix_content.element_factory", "@debug.stopwatch", "%cumulus_connector_host%", "%cumulus_connector_path%", "%cumulus_connector_catalog_id%"]
  tags:
    -  { name: phoenix_content.connector }

phoenix_content.connector.database:
  class: Phoenix\Bundle\ContentBundle\Connector\DatabaseConnector
  arguments: ["@phoenix_content.element_factory", "@debug.stopwatch", "@doctrine.orm.entity_manager"]
  tags:
    -  { name: phoenix_content.connector }

##
# Elements (for element factory)
##
phoenix_content.element.dummy:
  class: Phoenix\Bundle\ContentBundle\Element\Type\TypeDummy
  arguments: ["@phoenix_content.renderDirective"]
  tags:
    -  { name: phoenix_content.element }

phoenix_content.element.string:
  class: Phoenix\Bundle\ContentBundle\Element\Type\TypeString
  arguments: ["@phoenix_content.renderDirective"]
  tags:
    -  { name: phoenix_content.element }

phoenix_content.element.image:
  class: Phoenix\Bundle\ContentBundle\Element\Type\TypeImage
  arguments: ["%cumulus_dummy_image%", "@phoenix_content.renderDirective"]
  tags:
    -  { name: phoenix_content.element }

phoenix_content.element.link:
  class: Phoenix\Bundle\ContentBundle\Element\Type\TypeLink
  arguments: ["@phoenix_content.renderDirective"]
  tags:
    -  { name: phoenix_content.element }

phoenix_content.element.navigation:
  class: Phoenix\Bundle\ContentBundle\Element\Type\TypeNavigation
  arguments: ["@phoenix_content.tree_node_repository", "@phoenix_content.renderDirective"]
  tags:
    -  { name: phoenix_content.element }

phoenix_content.tree_node_repository:
  class: Phoenix\Bundle\ApiBundle\Entity\TreeNodeRepository
  factory_service: doctrine.orm.entity_manager
  factory_method:  getRepository
  arguments:
    - Phoenix\Bundle\ApiBundle\Entity\TreeNode


##
# Rendering
##
phoenix_content.pageModuleStorage:
  class: Phoenix\Bundle\ContentBundle\Render\PageModuleStorage
  arguments: []
  lazy: true

phoenix_content.renderDirective:
  class: Phoenix\Bundle\ContentBundle\Render\RenderDirective
  arguments: []
  lazy: true

phoenix_content.renderService:
  class: Phoenix\Bundle\ContentBundle\Render\RenderService
  arguments: ["@phoenix_content.renderDirective", "@phoenix_content.connector_factory", "@phoenix_content.twig.environment", "@phoenix_content.pageModuleStorage", "%statify.target_path%", "@phoenix_content.placeholderInterpreter"]
  lazy: true

phoenix_content.placeholderInterpreter:
  class: Phoenix\Bundle\ContentBundle\Render\PlaceholderInterpreter
  arguments: ["@phoenix_content.connector.contentful"]
  lazy: true


##
# Statification
##
phoenix_content.statify:
  class: Phoenix\Bundle\ContentBundle\Statify\Statify
  arguments: ["@doctrine.orm.entity_manager", "@phoenix_content.renderService", "%statify.target_path%"]

phoenix_content.statify_command:
  class: Phoenix\Bundle\ContentBundle\Console\StatifyCommand
  arguments: ["@phoenix_content.statify"]
  tags:
    -  { name: console.command }


##
# Metrics
##
phoenix_content.metrics:
  class: Hal\Application\Command\RunMetricsCommand
  arguments: []
  tags:
    -  { name: console.command }

First I was thinking that there is aredundancy in the code but I cann not find one? Do you see any problems here? Or is it a version error?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 关于多单片机模块化的一些问题
    • ¥30 seata使用出现报错,其他服务找不到seata
    • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
    • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
    • ¥15 Google speech command 数据集获取
    • ¥15 vue3+element-plus页面崩溃
    • ¥15 像这种代码要怎么跑起来?
    • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
    • ¥15 pyqt5tools安装失败
    • ¥15 mmdetection