安装和配置Kohana后,我重命名了install.php文件(根据用户指南)。但是当我现在去localhost / kohana时,我收到以下错误:
ErrorException [ 8 ]: Array to string conversion ~ SYSPATH/classes/Kohana/Log/Writer.php [ 81 ]
我无法在网络上的其他地方找到解决方案。有没有人有任何想法如何解决这个问题?谢谢!
答案 0 :(得分:4)
这是一个Kohana 3.3版本的bug。查看here了解更多详情。
答案 1 :(得分:4)
这是该bug的修补程序。希望这有助于其他人 https://github.com/kohana/core/commit/82b470b2827470da37b0e6771b77c369c3d2e5fb
<强>类/ Kohana的/日志/ Writer.php 强>
public function format_message(array $message, $format = "time --- level: body in file:line")
{
$message['time'] = Date::formatted_time('@'.$message['time'], Log_Writer::$timestamp, Log_Writer::$timezone, TRUE);
$message['level'] = $this->_log_levels[$message['level']];
- // FIX: $message should consist of an array of strings
- $message = array_filter($message, 'is_string');
-
- $string = strtr($format, $message);
+ $string = strtr($format, array_filter($message, 'is_scalar'));
if (isset($message['additional']['exception']))
{
$message['body'] = $message['additional']['exception']->getTraceAsString();
$message['level'] = $this->_log_levels[Log_Writer::$strace_level];
- $string .= PHP_EOL.strtr($format, $message);
+ $string .= PHP_EOL.strtr($format, array_filter($message, 'is_scalar'));
}
return $string;
注意到'+'表示添加了行,' - '表示从v3.3中删除行