Browse files

Zend Developer Tools integration based on #51 logs implementation.

  • Loading branch information...
1 parent 42c0e3b commit 983c19867d350ccd694317056cc183eccb74f510 @jhuet jhuet committed Dec 1, 2012
View
25 config/module.config.php
@@ -54,6 +54,10 @@
)
),
+ 'mongo_logger_collector' => array(
+ 'odm_default' => array(),
+ ),
+
'authentication' => array(
'odm_default' => array(
'objectManager' => 'doctrine.documentmanager.odm_default',
@@ -63,4 +67,25 @@
),
),
),
+
+ // zendframework/zend-developer-tools specific settings
+
+ 'view_manager' => array(
+ 'template_map' => array(
+ 'zend-developer-tools/toolbar/doctrine-odm' => __DIR__ . '/../view/zend-developer-tools/toolbar/doctrine-odm.phtml',
+ ),
+ ),
+
+ 'zenddevelopertools' => array(
+ 'profiler' => array(
+ 'collectors' => array(
+ 'odm_default' => 'doctrine.mongo_logger_collector.odm_default',
+ ),
+ ),
+ 'toolbar' => array(
+ 'entries' => array(
+ 'odm_default' => 'zend-developer-tools/toolbar/doctrine-odm',
+ ),
+ ),
+ ),
);
View
117 src/DoctrineMongoODMModule/Collector/MongoLoggerCollector.php
@@ -0,0 +1,117 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+namespace DoctrineMongoODMModule\Collector;
+
+
+use ZendDeveloperTools\Collector\CollectorInterface;
+use ZendDeveloperTools\Collector\AutoHideInterface;
+
+use Zend\Mvc\MvcEvent;
+
+use DoctrineMongoODMModule\Logging\DebugStack;
+
+/**
+ * Collector to be used in ZendDeveloperTools to record and display Mongo
+ * queries
+ *
+ * @license MIT
+ * @link www.doctrine-project.org
+ */
+class MongoLoggerCollector implements CollectorInterface, AutoHideInterface
+{
+ /**
+ * Collector priority
+ */
+ const PRIORITY = 10;
+
+ /**
+ * @var DebugStack
+ */
+ protected $mongoLogger;
+
+ /**
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * @param DebugStack $mongoLogger
+ * @param string $name
+ */
+ public function __construct(DebugStack $mongoLogger, $name)
+ {
+ $this->mongoLogger = $mongoLogger;
+ $this->name = (string) $name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getPriority()
+ {
+ return static::PRIORITY;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function collect(MvcEvent $mvcEvent)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function canHide()
+ {
+ return empty($this->mongoLogger->queries);
+ }
+
+ /**
+ * @return int
+ */
+ public function getQueryCount()
+ {
+ return count($this->mongoLogger->queries);
+ }
+
+ /**
+ * @return array
+ */
+ public function getQueries()
+ {
+ return $this->mongoLogger->queries;
+ }
+
+ /**
+ * @return float
+ */
+ public function getQueryTime()
+ {
+ return 0.0;
+ }
+}
View
9 src/DoctrineMongoODMModule/Module.php
@@ -50,6 +50,14 @@ public function onBootstrap(EventInterface $event)
// Attach to helper set event and load the document manager helper.
$sharedManager->attach('doctrine', 'loadCli.post', array($this, 'loadCli'));
+
+ $config = $app->getServiceManager()->get('Configuration');
+ if (
+ isset($config['zenddevelopertools']['profiler']['enabled'])
+ && $config['zenddevelopertools']['profiler']['enabled']
+ ) {
+ $app->getServiceManager()->get('doctrine.mongo_logger_collector.odm_default');
+ }
}
/**
@@ -119,6 +127,7 @@ public function getServiceConfig()
'doctrine.driver.odm_default' => new CommonService\DriverFactory('odm_default'),
'doctrine.documentmanager.odm_default' => new ODMService\DocumentManagerFactory('odm_default'),
'doctrine.eventmanager.odm_default' => new CommonService\EventManagerFactory('odm_default'),
+ 'doctrine.mongo_logger_collector.odm_default' => new ODMService\MongoLoggerCollectorFactory('odm_default'),
)
);
}
View
100 src/DoctrineMongoODMModule/Options/MongoLoggerCollector.php
@@ -0,0 +1,100 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineMongoODMModule\Options;
+
+use Zend\Stdlib\AbstractOptions;
+
+/**
+ * Configuration options for a collector
+ *
+ * @license MIT
+ * @link http://www.doctrine-project.org/
+ */
+class MongoLoggerCollector extends AbstractOptions
+{
+ /**
+ * @var string name to be assigned to the collector
+ */
+ protected $name = 'odm_default';
+
+ /**
+ * @var string|null service name of the configuration where the logger has to be put
+ */
+ protected $configuration;
+
+ /**
+ * @var string|null service name of the Logger to be used
+ */
+ protected $mongoLogger;
+
+ /**
+ * @param string $name
+ */
+ public function setName($name)
+ {
+ $this->name = (string) $name;
+ }
+
+ /**
+ * Name of the collector
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * @param string|null $configuration
+ */
+ public function setConfiguration($configuration)
+ {
+ $this->configuration = $configuration ? (string) $configuration : null;
+ }
+
+ /**
+ * Configuration service name (where to set the logger)
+ *
+ * @return string
+ */
+ public function getConfiguration()
+ {
+ return $this->configuration ? $this->configuration : 'doctrine.configuration.odm_default';
+ }
+
+ /**
+ * @param string|null $mongoLogger
+ */
+ public function setMongoLogger($mongoLogger)
+ {
+ $this->mongoLogger = $mongoLogger ? (string) $mongoLogger : null;
+ }
+
+ /**
+ * Logger service name
+ *
+ * @return string|null
+ */
+ public function getMongoLogger()
+ {
+ return $this->mongoLogger;
+ }
+}
View
89 src/DoctrineMongoODMModule/Service/MongoLoggerCollectorFactory.php
@@ -0,0 +1,89 @@
+<?php
+/*
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * and is licensed under the MIT license. For more information, see
+ * <http://www.doctrine-project.org>.
+ */
+
+namespace DoctrineMongoODMModule\Service;
+
+use DoctrineModule\Service\AbstractFactory;
+
+use Zend\ServiceManager\ServiceLocatorInterface;
+
+use DoctrineMongoODMModule\Collector\MongoLoggerCollector;
+
+use DoctrineMongoODMModule\Logging\DebugStack;
+use DoctrineMongoODMModule\Logging\LoggerChain;
+
+/**
+ * Mongo Logger Configuration ServiceManager factory
+ *
+ * @license MIT
+ * @link http://www.doctrine-project.org/
+ */
+class MongoLoggerCollectorFactory extends AbstractFactory
+{
+ /**
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * @param $name
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function createService(ServiceLocatorInterface $serviceLocator)
+ {
+ /** @var $options \DoctrineMongoODMModule\Options\MongoLoggerCollector */
+ $options = $this->getOptions($serviceLocator, 'mongo_logger_collector');
+
+ if ($options->getMongoLogger()) {
+ $debugStackLogger = $serviceLocator->get($options->getMongoLogger());
+ } else {
+ $debugStackLogger = new DebugStack();
+ }
+
+ /** @var $options \Doctrine\ODM\MongoDB\Configuration */
+ $configuration = $serviceLocator->get($options->getConfiguration());
+
+ if (null !== $configuration->getLoggerCallable()) {
+ $logger = new LoggerChain();
+ $logger->addLogger($debugStackLogger);
+ $callable = $configuration->getLoggerCallable();
+ $logger->addLogger($callable[0]);
+ $configuration->setLoggerCallable(array($logger, 'log'));
+ } else {
+ $configuration->setLoggerCallable(array($debugStackLogger, 'log'));
+ }
+
+ return new MongoLoggerCollector($debugStackLogger, $options->getName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getOptionsClass()
+ {
+ return 'DoctrineMongoODMModule\Options\MongoLoggerCollector';
+ }
+}
View
206 view/zend-developer-tools/toolbar/doctrine-odm.phtml
@@ -0,0 +1,206 @@
+<div class="zdt-toolbar-entry">
+ <div class="zdt-toolbar-preview">
+ <img src="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzU1MkQ0QURDODkyMTFFMUE4RDU5MDZBOEM2RTM5QjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzU1MkQ0QUVDODkyMTFFMUE4RDU5MDZBOEM2RTM5QjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NTUyRDRBQkM4OTIxMUUxQThENTkwNkE4QzZFMzlCNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NTUyRDRBQ0M4OTIxMUUxQThENTkwNkE4QzZFMzlCNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PryYMQ8AAAN9SURBVHjapFRdSJNhFH6/7dvUzQWbOLacM92UNW1E4WDRhWKhiN0JEUU3/RAIXdiV0I1dKF7oRRe7mCmIonZRJM0agqRgiZIs0VnD5s/mVNRl4eZ+3E/PO76FjBVWBx7O9573fc97znPO+Riv10uOyVXgJnAOOAvkkMziARzAG+BlQUHBLyfMxsYG1bcAMyCJRqORra2tA4fDEfR4PEeQOAOhhxKJBMnLyxPodDpBSUlJrkQiyeX89AMPVCrVIYtD97CwjI6Ouru7u7/Mzc35uAiWgW3gCOBxF+OAFDgDaBCZsr6+XtbS0nKdZdnzsBmYmZmZjwqF4mJxcfGjeDz+an19fYWcUIqKiqhzo8VieVZbW6vCmmEXFhbicrmcuFyux5Q3OLVBuwDKBY02keZHBJwGlKurq9XQ9YAqGAzG6CYLTo7ghHCp3OVA+foG6nzpKcN+CnYlvvnHXxEIBMk1a7fbvRUVFZkykuGyLNMGLU66oFsCVPP39vaI2+02aLXaXJFIRItE/hYjIyMbXV1dU+iO5+zAwMCV2dnZybq6Oqlery9paGjILysrk6jVapFUKs1KjyQcDsdwMQj+/BMTE76pqakfoO1tb2+vqbKykjCDg4MfDAaDCTxOLy0tvWhvb+fPz8/ni8ViLbjKgz3B4/GYVJqwhdCbHvSrq7m52d/Y2FiOs/fpHqhjWLxIuKKYEKGpv5/2KNmBzQE48U25YbkeZOBcAacm4DZnT96PxWLJF9n9/f3vWKRnJqfApepMBclUlFTb8BcXF8Xg6oJGozn1LwWhWFtbO2hra/sE3cMODQ3JQajVbDYbMEb5VVVVcsykKDs7m/3TlOzu7obQcr6xsbFdaHtPT88hikSY4eHh9xiZS36//2lHR8fy9PR0eSAQUGMUZYhcAM6SteAmhsFebHt7OwyqPKWlpZ+bmpqCRqPxDujRmUwmhsUmU1hYSNCDD1tbW2kKbmzO+Xy+yc3NTS8chPh8Pg/2BP3rYExlSqVSKxQK9XjgRorXSCSSrCyLkYlyVU6JGgfUiI5Q/E7S7hD6KNU88DeJRj2kB/4HfX19X5OO4cxptVrVaNQcCF8mk2WftLoY2xA43+ns7HTabLYn8LfEjI+Pk5qaGiEW15B+FQi+jCKJ8EcWw3kWUmGOp4biRcFtEL87v9PpXMEIvoP5NffLIz8FGAAqeUQbl180BwAAAABJRU5ErkJggg==" alt="Database (Zend\Db)">
+ <span class="zdt-toolbar-info">
+ <?php echo $this->collector->getQueryCount(); ?> queries
+ </span>
+ </div>
+ <div class="zdt-toolbar-detail">
+ <span class="zdt-toolbar-info zdt-toolbar-info-heading">Details</span>
+ <span class="zdt-toolbar-info">
+ <span class="zdt-detail-label">Help us!</span>
+ <span class="zdt-detail-value zdt-detail-value-right">
+ Please help us improve
+ <br/>
+ profiling by forking and
+ <br/>
+ contributing to
+ <br/>
+ <a href="https://github.com/doctrine/DoctrineMongoODMModule/fork_select" target="_blank">
+ DoctrineMongoODMModule
+ </a>
+ </span>
+ </span>
+
+ <span class="zdt-toolbar-info zdt-toolbar-info-heading">Queries</span>
+ <span class="zdt-toolbar-info ddt-toolbar-info">
+ <?php foreach ($this->collector->getQueries() as $query): ?>
+ <hr/>
+
+ <?php if (isset($query['db'])): ?>
+ <span class="zdt-detail-label">Database</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['db']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['collection'])): ?>
+ <span class="zdt-detail-label">Collection</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['collection']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <span class="zdt-detail-label">Query</span>
+ <span class="zdt-detail-value ddt-detail-query ddt-detail-value">
+
+ <?php if (isset($query['query']) && is_array($query['query']) && !empty($query['query'])): ?>
+ <?php foreach($query['query'] as $key => $value): ?>
+ <?php print_r($value) ?>
+ <?php endforeach ?>
+ <?php endif ?>
+ </span>
+
+ <span class="clear"></span>
+
+ <?php if (isset($query['fields']) && is_array($query['fields']) && !empty($query['fields'])): ?>
+ <span class="zdt-detail-label">Fields</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php foreach($query['fields'] as $key => $value): ?>
+ &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $key ?> => <?php print_r($value) ?>
+ <?php endforeach ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['find'])): ?>
+ <span class="zdt-detail-label">Find</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['find']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['limit'])): ?>
+ <span class="zdt-detail-label">Limit to</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['limitNum']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['sort'])): ?>
+ <span class="zdt-detail-label">Sort by</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['sortFields']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['skip'])): ?>
+ <span class="zdt-detail-label">Skip to</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php \Doctrine\Common\Util\Debug::dump($query['skipNum']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['authenticate'])): ?>
+ <span class="zdt-detail-label">Authenticate</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;username => <?php \Doctrine\Common\Util\Debug::dump($query['username']) ?><br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;password => <?php \Doctrine\Common\Util\Debug::dump($query['password']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['command'])): ?>
+ <span class="zdt-detail-label">Command</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;data => <?php \Doctrine\Common\Util\Debug::dump($query['data']) ?><br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;options => <?php \Doctrine\Common\Util\Debug::dump($query['options']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['createCollection'])): ?>
+ <span class="zdt-detail-label">Create collection</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;capped => <?php \Doctrine\Common\Util\Debug::dump($query['capped']) ?><br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;size => <?php \Doctrine\Common\Util\Debug::dump($query['size']) ?><br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;max => <?php \Doctrine\Common\Util\Debug::dump($query['max']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['createDBRef'])): ?>
+ <span class="zdt-detail-label">Create DB ref</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;collection => <?php \Doctrine\Common\Util\Debug::dump($query['collection']) ?><br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;reference => <?php \Doctrine\Common\Util\Debug::dump($query['reference']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['getDBRef'])): ?>
+ <span class="zdt-detail-label">Get DB ref</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;reference => <?php \Doctrine\Common\Util\Debug::dump($query['reference']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['drop'])): ?>
+ <span class="zdt-detail-label">Drop database</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ &nbsp;&nbsp;&nbsp;&nbsp;dropDatabase => <?php \Doctrine\Common\Util\Debug::dump($query['dropDatabase']) ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+
+ <?php if (isset($query['execute'])): ?>
+ <span class="zdt-detail-label">Code</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php print_r($query['code']) ?>
+ </span>
+ <span class="clear"></span>
+ <span class="zdt-detail-label">Args</span>
+ <span class="zdt-detail-value ddt-detail-value">
+ <?php foreach($query['args'] as $key => $value): ?>
+ &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $key ?> => <?php \Doctrine\Common\Util\Debug::dump($value) ?><br/>
+ <?php endforeach ?>
+ </span>
+ <span class="clear"></span>
+ <?php endif ?>
+ <?php endforeach ?>
+ </span>
+ </div>
+</div>
+<style>
+.zdt-toolbar-entry .zdt-toolbar-detail .ddt-toolbar-info {
+
+ font-size: 11px;
+ max-width: 600px;
+ witdh: 600px;
+ max-height: 300px;
+ overflow-y: scroll;
+ overflow-x: hidden;
+}
+
+.zdt-toolbar-entry .zdt-toolbar-detail .ddt-detail-query {
+
+ white-space: normal;
+ width: 400px;
+}
+
+.zdt-toolbar-entry .zdt-toolbar-detail .ddt-detail-query .highlight {
+
+ color: #80DC09;
+ font-weight: bold;
+}
+
+.zdt-toolbar-entry .zdt-toolbar-info .clear {
+
+ clear: both;
+ display: block;
+}
+
+.zdt-toolbar-entry .zdt-toolbar-detail .ddt-toolbar-info hr {
+
+ border: 0;
+ border-top: 1px solid #80DC09;
+ clear: both;
+}
+</style>

0 comments on commit 983c198

Please sign in to comment.