为什么我在视图顶部看到我的 Doctrine 查询的文本?

Why am I seeing the Text of my Doctrine Query at the Top of my View?

我在生成的视图顶部看到由 doctrine2 的查询生成器生成的查询文本。 (我正在使用 Chrome)

有谁知道什么可以将此文本字符串注入视图主体?除了这个字符串外,视图中的所有内容似乎都能正确呈现。

我已经检查了我的观点的代码,我没有使用任何 php 回声语句,还有另一个 SO post 有一个答案提到检查那个。但这似乎不是我问题的根源。

我已经弄清楚是什么导致了这个问题。作为 doctrine2 和 CodeIgniter 3 集成的一部分,我已经包含了 EchoSQLLogger in my application\libraries\Doctrine.php file based upon another guide。这会将 sql 查询转储到标准输出,这就是我在网络视图中看到我的查询的原因。

<?php
$config->setSQLLogger($logger);
$config->getSQLLogger();

Gets or sets the logger to use for logging all SQL statements executed by Doctrine. The logger class must implement the Doctrine\DBAL\Logging\SQLLogger > interface. A simple default implementation that logs to the standard output using echo and var_dump can be found at Doctrine\DBAL\Logging\EchoSQLLogger.