在安装和配置Kohana之后,我重命名了install.php文件(根据用户指南)。但是当我现在转到localhost/kohana时,我得到了以下错误:
ErrorException [ 8 ]: Array to string conversion ~ SYSPATH/classes/Kohana/Log/Writer.php [ 81 ]我在网上的其他地方找不到解决方案。有没有人知道如何解决这个问题?谢谢!
发布于 2013-07-03 20:13:50
这是一个Kohana 3.3版本的bug。有关更多细节,请查看here。
发布于 2013-11-29 14:34:09
这是对那个bug的热修复。希望这能帮助其他人https://github.com/kohana/core/commit/82b470b2827470da37b0e6771b77c369c3d2e5fb
classes/Kohana/Log/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中删除了行
https://stackoverflow.com/questions/17447079
复制相似问题