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

时间:2015-12-21 11:33:01

标签: php symfony

将Symfony从2.7.2更新为2.7.7后,出现以下错误:

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

这是我的services.yml文件:

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 }

首先,我认为代码中存在重要性,但我找不到代码?你在这看到有什么问题吗?或者是版本错误?

0 个答案:

没有答案