Author: Kris.Wallsmith
Date: 2010-04-06 19:42:14 +0200 (Tue, 06 Apr 2010)
New Revision: 28999
Modified:
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
Log:
[1.3, 1.4] fixed fatal error in WDT when use_database is false but doctrine
plugin is enabled
Modified:
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
===================================================================
---
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
2010-04-06 15:41:15 UTC (rev 28998)
+++
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
2010-04-06 17:42:14 UTC (rev 28999)
@@ -76,14 +76,17 @@
$databaseManager = sfContext::getInstance()->getDatabaseManager();
$events = array();
- foreach ($databaseManager->getNames() as $name)
+ if ($databaseManager)
{
- $database = $databaseManager->getDatabase($name);
- if ($database instanceof sfDoctrineDatabase && $profiler =
$database->getProfiler())
+ foreach ($databaseManager->getNames() as $name)
{
- foreach ($profiler->getQueryExecutionEvents() as $event)
+ $database = $databaseManager->getDatabase($name);
+ if ($database instanceof sfDoctrineDatabase && $profiler =
$database->getProfiler())
{
- $events[$event->getSequence()] = $event;
+ foreach ($profiler->getQueryExecutionEvents() as $event)
+ {
+ $events[$event->getSequence()] = $event;
+ }
}
}
}
Modified:
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
===================================================================
---
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
2010-04-06 15:41:15 UTC (rev 28998)
+++
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php
2010-04-06 17:42:14 UTC (rev 28999)
@@ -76,14 +76,17 @@
$databaseManager = sfContext::getInstance()->getDatabaseManager();
$events = array();
- foreach ($databaseManager->getNames() as $name)
+ if ($databaseManager)
{
- $database = $databaseManager->getDatabase($name);
- if ($database instanceof sfDoctrineDatabase && $profiler =
$database->getProfiler())
+ foreach ($databaseManager->getNames() as $name)
{
- foreach ($profiler->getQueryExecutionEvents() as $event)
+ $database = $databaseManager->getDatabase($name);
+ if ($database instanceof sfDoctrineDatabase && $profiler =
$database->getProfiler())
{
- $events[$event->getSequence()] = $event;
+ foreach ($profiler->getQueryExecutionEvents() as $event)
+ {
+ $events[$event->getSequence()] = $event;
+ }
}
}
}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.