Z-Ray for Yii2

      No Comments on Z-Ray for Yii2

Over the past few months, I’ve been asked quite a lot when Z-Ray would support the Yii2 framework. So here, finally, is the answer – this brief article introduces the new Z-Ray plugin for Yii2 developed by Techies India Inc.

First, and as a short reminder to those new to the concept of Zend Server plugins – plugins are basically pieces of code that extend Zend Server’s functionality in a variety of ways. Z-Ray plugins result in adding specific information in Z-Ray on the app/framework/platform you’re developing.

There are already more than 20 Z-Ray plugins for some of the popular PHP apps and frameworks such as WordPress, Drupal, Magento, Joomla, Zend Framework, Symfony, Laravel and more, and now – also for Yii2.

Overview

Let’s first take a look at the information the plugin displays.

Logger_panel

Starting from left to right:

Asset Bundles

This first panel lists all the used Yii2 asset bundles on the page, with information on the bundle name, its path, css, js and ‘depends on’ information.

DB Logger

The DB Logger panel gives you a list of all the SQL statements executed during the life cycle of the current request. This logging information includes type, query, duration, timestamp, trace and sequence of the SQL statement execution.

Logger

This panel lists all the Yii2 log messages for the current request. The information includes message, category, level and time of execution.

Page Info

The Page Info panel shows general page info such as the current route, the status code received and the action serving the current route.

Extensions

This panel gives you a list of all the extensions installed in the Yii2 application with their name and version.

Config Info

Last but not least, the Config Info panel displays configuration information which includes the Yii2 version, the application name, environment, debug mode, PHP version, and more.

Installation

Installing the Yii2 plugin for Z-Ray is easy:

  1. Access the Zend Server UI (just click the Zend Server logo on Z-Ray itself).
  2. Go to the Plugins | Plugins Gallery page.
  3. Locate the Yii2 Framework plugin, and click the Install button.
  4. Complete the short deployment wizard, and Bob’s your uncle!

The Yii2  extension is a great example of how to extend Z-Ray. If you’re thinking of developing your own plugin for Z-Ray, all the documentation you need to learn how to build a Z-Ray extension is detailed beautifully on GitHub. There are additinal available resources as well, so feel free to drop me a line: daniel.be@zend.com, @proudboffin