[phpBB] cronstatus extension - container_exception (YAML, PHP)

CONTAINER_EXCEPTION

EXCEPTION: The file "/.../ext/boardtools/cronstatus/config/services.yml" does not contain valid YAML: The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 5 (near "- @config").

#0 /.../vendor/symfony/dependency-injection/Loader/YamlFileLoader.php(117): Symfony\Component\DependencyInjection\Loader\YamlFileLoader->loadFile()
#1 /.../phpbb/extension/di/extension_base.php(99): Symfony\Component\DependencyInjection\Loader\YamlFileLoader->load()
#2 /.../phpbb/extension/di/extension_base.php(63): phpbb\extension\di\extension_base->load_services()
#3 /.../vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php(71): phpbb\extension\di\extension_base->load()
#4 /.../vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php(39): Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process()
#5 /.../vendor/symfony/dependency-injection/Compiler/Compiler.php(140): Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process()
#6 /.../vendor/symfony/dependency-injection/ContainerBuilder.php(789): Symfony\Component\DependencyInjection\Compiler\Compiler->compile()
#7 /.../phpbb/di/container_builder.php(223): Symfony\Component\DependencyInjection\ContainerBuilder->compile()
#8 /.../common.php(125): phpbb\di\container_builder->get_container()
#9 /.../adm/index.php(23): require('...') #10 {main}
CONTAINER_EXCEPTION - The file does not contain valid YAML: ...

  phpBB에서 쓸 수 있는 Cron Status 확장 기능(3.1.2)은 phpbb 3.1.×에 맞추어져 있다. phpbb 3.3.×에 쓰려고 Cron Status를 깔면 위와 같은 오류가 나올 수 있다.

  phpBB • ACP error when installing this extension with v3.3 - Cron Status에 해결 방법이 나와 있다.

  .../ext/boardtools/cronstatus/config/services.yml에서 아래처럼 작은따옴표(')를 붙여 준다.

services:
boardtools.cronstatus.listener:
class: boardtools\cronstatus\event\listener
arguments:
- @config
- @controller.helper
- @user
- @template
- @dbal.conn
- @cron.manager
- @dispatcher
tags:
- { name: event.listener }

services:
boardtools.cronstatus.listener:
class: boardtools\cronstatus\event\listener
arguments:
- '@config'
- '@controller.helper'
- '@user'
- '@template'
- '@dbal.conn'
- '@cron.manager'
- '@dispatcher'
tags:
- { name: event.listener }

  services.yml 파일만 고쳐도 위의 오류는 없앨 수 있다.

.../ext/boardtools/cronstatus/event/listener.php에서 아래 두 곳을 찾아 조건문을 덧붙여 준다.

			$rows[] = array(
"config_name" => "prune_forum_last_gc", // This is the time of the last Cron Job, not the time of pruned forums.
"config_value" => $prune['prune_next'] - $prune['prune_time']
);
$rows[] = array(
"config_name" => "prune_forum_gc",
"config_value" => $prune['prune_time']
);

		if ($prune)
{
$rows[] = array(
"config_name" => "prune_forum_last_gc", // This is the time of the last Cron Job, not the time of pruned forums.
"config_value" => $prune['prune_next'] - $prune['prune_time']
);
$rows[] = array(
"config_name" => "prune_forum_gc",
"config_value" => $prune['prune_time']
);
}

 

			$rows[] = array(
"config_name" => "prune_shadow_topics_last_gc", // This is the time of the last Cron Job, not the time of pruned shadow topics.
"config_value" => $prune_shadow['prune_shadow_next'] - $prune_shadow['prune_shadow_time']
);
$rows[] = array(
"config_name" => "prune_shadow_topics_gc",
"config_value" => $prune_shadow['prune_shadow_time']
);

		if ($prune_shadow)
{
$rows[] = array(
"config_name" => "prune_shadow_topics_last_gc", // This is the time of the last Cron Job, not the time of pruned shadow topics.
"config_value" => $prune_shadow['prune_shadow_next'] - $prune_shadow['prune_shadow_time']
);
$rows[] = array(
"config_name" => "prune_shadow_topics_gc",
"config_value" => $prune_shadow['prune_shadow_time']
);
}
2024/05/06 16:53 2024/05/06 16:53
글 걸기 주소 : 이 글에는 글을 걸 수 없습니다.

덧글을 달아 주세요