I think I must be missing something obvious here. I have Doctrine and Zend Framework set up together. In the bootstrap.php file I have the following - based on the Doctrine documentation for using the profiler:
$profiler = new Doctrine_Connection_Profiler();
$conn = Doctrine_Manager::connection();
$conn->setListener($profiler);
(...)
$frontController = Zend_Controller_Front::getInstance();
(...)
$query_count = 0;
$time = 0;
echo "<table width='100%' border='1'>";
foreach ( $profiler as $event ) {
if ($event->getName() != 'execute') {
continue;
}
$query_count++;
echo "<tr>";
$time += $event->getElapsedSecs() ;
echo "<td>" . $event->getName() . "</td><td>" . sprintf ( "%f" , $event->getElapsedSecs() ) . "</td>";
echo "<td>" . $event->getQuery() . "</td>" ;
$params = $event->getParams() ;
if ( ! empty ( $params ) ) {
echo "<td>";
echo join(', ', $params);
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
echo "Total time: " . $time . ", query count: $query_count <br>\n ";
There are no errors, the profiler output at the end only prints: "Total time: 0, query count: 0".
The connection is definitely working, as the queries get executed - I've got a SELECT fetching a bunch of items using Doctrine_Query::create() and it's execute method.