"The reserved indicator "@“无法启动普通标量”——在 YML 文件中。 (将 SYMFONY 2.8 升级到 SYMFONY 3.0)
"The reserved indicator "@" cannot start a plain scalar" -- in YML file. (UPGRADE SYMFONY 2.8 TO SYMFONY 3.0)
最近,我正在将 symfony 升级到 3.0.9 版本。
当我用库解决了所有版本的问题时,我尝试了 运行 命令“php bin/console assets:install”或者命令“php [=19=” ] cache:clear”,但现在我可能遇到 YML 文件中的 sintaxis 问题:
C:\inetpub\wwwroot0forfuture>php bin/console a:i
[Symfony\Component\Config\Exception\FileLoaderLoadException]
The file "C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML in C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml (which is being imported from "C:\inetpub\wwwr
oot0forfuture\app/config\config.yml").
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The file "C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML.
[Symfony\Component\Yaml\Exception\ParseException]
The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 5 (near "arguments: [%printerserver_port%,%enviroment%,'@doctrine.orm.entity_manager','@request_stack','@reservas.reservas','@general.parametros','@general.establecimi
entos','@pos.tpv','@swiftmailer.mailer.tablereservation', @templating, @service_container]").
这是我的 YML 文件的一部分:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: '@ResTableBundle/Resources/config/services.yml'}
# fos
- { resource: fos/fos-rest.yml }
# knp
- { resource: knp/knp-menu.yml }
- { resource: knp/knp-paginator.yml }
有没有关于在此处替换“@”的想法?¿
这一行 '@swiftmailer.mailer.tablereservation', @templating, @service_container] 在哪里,您需要在模板和 service_container 参数周围加上引号。您可能需要检查所有服务文件并根据需要应用引号。题外话,但如果这是一个非常重要的项目,那么您应该考虑创建一个新的 4.4(甚至 5.2)项目,然后移动相关部分。您可能最终会在您的方法上浪费大量时间,尤其是当@'s 之类的东西拖慢您的速度时。
最近,我正在将 symfony 升级到 3.0.9 版本。 当我用库解决了所有版本的问题时,我尝试了 运行 命令“php bin/console assets:install”或者命令“php [=19=” ] cache:clear”,但现在我可能遇到 YML 文件中的 sintaxis 问题:
C:\inetpub\wwwroot0forfuture>php bin/console a:i
[Symfony\Component\Config\Exception\FileLoaderLoadException]
The file "C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML in C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml (which is being imported from "C:\inetpub\wwwr
oot0forfuture\app/config\config.yml").
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The file "C:\inetpub\wwwroot0forfuture\src\H360\ResTableBundle/Resources/config/services.yml" does not contain valid YAML.
[Symfony\Component\Yaml\Exception\ParseException]
The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 5 (near "arguments: [%printerserver_port%,%enviroment%,'@doctrine.orm.entity_manager','@request_stack','@reservas.reservas','@general.parametros','@general.establecimi
entos','@pos.tpv','@swiftmailer.mailer.tablereservation', @templating, @service_container]").
这是我的 YML 文件的一部分:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: '@ResTableBundle/Resources/config/services.yml'}
# fos
- { resource: fos/fos-rest.yml }
# knp
- { resource: knp/knp-menu.yml }
- { resource: knp/knp-paginator.yml }
有没有关于在此处替换“@”的想法?¿
这一行 '@swiftmailer.mailer.tablereservation', @templating, @service_container] 在哪里,您需要在模板和 service_container 参数周围加上引号。您可能需要检查所有服务文件并根据需要应用引号。题外话,但如果这是一个非常重要的项目,那么您应该考虑创建一个新的 4.4(甚至 5.2)项目,然后移动相关部分。您可能最终会在您的方法上浪费大量时间,尤其是当@'s 之类的东西拖慢您的速度时。