繁体   English   中英

Kohana ErrorException [8]

[英]Kohana ErrorException [ 8 ]

安装和配置Kohana后,我重命名了install.php文件(根据用户指南)。 但是当我现在去localhost / kohana时,我收到以下错误:

 ErrorException [ 8 ]: Array to string conversion ~ SYSPATH/classes/Kohana/Log/Writer.php [ 81 ]

我无法在网络上的其他地方找到解决方案。 有没有人有任何想法如何解决这个问题? 谢谢!

这是一个Kohana 3.3版本的bug。 点击这里查看更多详情。

这是该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中删除行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM