There are some awesome Zend Server Z-Ray plugins, but there was none for Doctrine 2. I like the Doctrine 2 Zend Developer Tools extension, but with Z-Ray there are so many possibilities to display Doctrine 2 information. And the best part is, it's so easy to develop. Simply trace the function you want and collect the desired data.

The Doctrine 2 plugin for Zend Server Z-Ray displays information about your entities and entity mappings, queries with parameter, events and used caches. Here are some impressions from the Doctrine 2 Zend Server Z-Ray plugin.

Tab Entities

Doctrine 2 Z-Ray plugin - tab entities

The Entities tab displays information about used entities of the current page and entity mappings. There are the following columns:

  • Entity: FCQN of the entity class
  • Number Of Unique Entities: How many unique objects of this entity exist
  • Number Of Referenced Entities: How many references exist for this entity

Tab Queries

Doctrine 2 Z-Ray plugin - tab queries

The Queries tab displays information about executed queries. There are the following columns:

  • #: Query number
  • Query: The executed query with parameter
  • Number: The number of executions
  • Cached: The number of cached queries

Note: real queries are calculated as Number - Cached.

Tab Events

Doctrine 2 Z-Ray plugin - tab events
The Events tab displays information about Doctrine 2 events with Symfony\Bridge\Doctrine support. There are the following columns:

  • Event: The event name
  • Number: The Number of occurrences
  • Listeners: Listener classes

Tab Cache

Doctrine 2 Z-Ray plugin - tab cache
The Cache tab displays information about Doctrine 2 caches and which cache driver is used. There are the following columns:

  • Type: The cache type
  • Status: Which cache driver is used

How to use latest Z-Ray Doctrine 2 plugin version?

It takes a while until Zend has released a new version of a plugin. But you can download the latest master and deploy manually. Simply open the Manage Plugins page on the Zend Server Backend and click on the update button. Now navigate to the downloaded plugin zip file and finish the installation.

Z-Ray Doctrine 2 Plugin Update

Need a demo project?

Z-Ray works also without Zend Server. See Z-Ray Technology Preview.

You want to see the features of the Z-Ray Doctrine 2 plugin, but you don't have a demo project? No problem. You can use the Z-Ray Doctrine 2 Shopware demo project with Vagrant / Docker support. So it's really easy to use and it's interesting how big projects uses Doctrine 2.

Hints

You can run into some minor pitfalls on start of creating a Z-Ray plugin.

  • Symlinks doesn't work. If you use Vagrant/Docker you should mount your extension source directly under /usr/local/zend/var/plugins/[extension-name]
  • The directory name must be the same name which was defined in zray.php
  • If nothing is shown in the Zend Server GUI (blank page) see /usr/local/zend/gui/lighttpd/logs/php.log
  • See Z-Ray DevBar folder to dive deeper into this area /usr/local/zend/gui/module/DevBar
  • And read the docs

If you have some suggestions or if you want to display some other information please open an issue on GitHub or send your pull request.