Develop Your First Zend Server Plugin – Part 2

+ADw-p+AD4-In the +ADw-a href+AD0AIg-http://devzone.zend.com/6149/develop-your-first-zend-server-plugin-part-1/+ACIAPg-previous+ADw-/a+AD4??article in this series you learned how to develop a Z-Ray plugin. Once you feel your plugin is ready, you can share it with the entire community via??the new Zend Server Plugin Gallery, or +ACYAIw-8211+ADs deploy it on your Zend Server for easier management and handling.+ADw-/p+AD4
+ADw-p+AD4-This article describes how to package the plugin and prepare it for deployment on Zend Server or for submission into the gallery.+ADw-/p+AD4
+ADw-h1+AD4-Prerequisites+ADw-/h1+AD4
+ADw-p+AD4-To follow the steps in this tutorial, you will need to do the following:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4APA-a href+AD0AIg-http://www.zend.com/en/downloads+ACIAPg-Download+ADw-/a+AD4, +ADw-a href+AD0AIg-http://files.zend.com/help/Zend-Server/zend-server.htm+ACM-installation+AF8-guide.htm+ACIAPg-install+ADw-/a+AD4, and +ADw-a href+AD0AIg-http://files.zend.com/help/Zend-Server/zend-server.htm+ACM-launching+AF8-zend+AF8-server.htm+ACIAPg-launch +ADw-/a+AD4-Zend Server 8.5.x and above+ADw-/li+AD4
+ADw-li+AD4-A finished Zend Server plugin. Click +ADw-a href+AD0AIg-https://github.com/zend-server-plugins/Documentation+ACIAPg-here+ADw-/a+AD4 to learn how to develop a Zend Server plugin.+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-h1+AD4-Step 1 : Packaging your Plugin+ADw-/h1+AD4
+ADw-p+AD4-A Zend Server plugin package is a simple compressed .zip file containing the plugin folders and files.+ADw-/p+AD4
+ADw-p+AD4-Once you???ve finished developing the plugin, make sure it+ACYAIw-8217+ADs-s constructed according to this plugin structure:+ADw-/p+AD4
+ADw-h2+AD4APA-b+AD4-Plugin Sub-Directories+ADw-/b+AD4APA-/h2+AD4
+ADw-p+AD4-Plugins contain one, or both, of the following two folders:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Z-Ray +ACYAIw-8211+ADs contains the Z-Ray plugin files (zray.php, additional Z-Ray plugin files)+ADw-/li+AD4
+ADw-li+AD4-Route +ACYAIw-8211+ADs contains the Route plugin file (route.php)+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-h2+AD4APA-b+AD4-EULA (optional)+ADw-/b+AD4APA-/h2+AD4
+ADw-p+AD4-The plugin??end user license agreement.+ADw-/p+AD4
+ADw-h2+AD4APA-b+AD4-README (optional)+ADw-/b+AD4APA-/h2+AD4
+ADw-p+AD4-The plugin readme file typically includes a description of the plugin, including details on the information displayed in the plugin and the popular use cases. Can be formatted using Markdown.+ADw-/p+AD4
+ADw-h2+AD4APA-b+AD4-Logo (optional)+ADw-/b+AD4APA-/h2+AD4
+ADw-p+AD4-The plugin logo is the main logo for the plugin and is displayed in the Zend Server Gallery. This logo should not be confused with the Z-Ray plugin logo used in the added panels.+ADw-/p+AD4
+ADw-p+AD4-The plugin logo should be 50X50px.+ADw-/p+AD4
+ADw-h2+AD4APA-b+AD4-deployment.json+ADw-/b+AD4APA-/h2+AD4
+ADw-p+AD4-The ???deployment.json??? file describes the plugin content, and can??contain all or some of the following parameters (please take that some??are required):+ADw-/p+AD4
+ADw-table+AD4
+ADw-tbody+AD4
+ADw-tr+AD4
+ADw-td+AD4APA-b+AD4-Name+ADw-/b+AD4APA-/td+AD4
+ADw-td+AD4APA-b+AD4-Required+ADw-/b+AD4APA-/td+AD4
+ADw-td+AD4APA-b+AD4-Description+ADw-/b+AD4APA-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-name+ADw-/td+AD4
+ADw-td+AD4-Yes+ADw-/td+AD4
+ADw-td+AD4-The name of the package. Try to be as unique as possible since this is the identifier of your package from now on. Lowercase is recommended.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-display+AF8-name+ADw-/td+AD4
+ADw-td+AD4-Yes+ADw-/td+AD4
+ADw-td+AD4-The plugin+ACYAIw-8217+ADs-s display name, visible to users and in the online plugin gallery.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-version+ADw-/td+AD4
+ADw-td+AD4-Yes+ADw-/td+AD4
+ADw-td+AD4-The version of the package.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-type+ADw-/td+AD4
+ADw-td+AD4-Yes+ADw-/td+AD4
+ADw-td+AD4-Array of one or more of the following values: zray, route.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-eula+ADw-/td+AD4
+ADw-td+AD4-No+ADw-/td+AD4
+ADw-td+AD4-Path to the end user agreement file, markdown supported.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-readme+ADw-/td+AD4
+ADw-td+AD4-No+ADw-/td+AD4
+ADw-td+AD4-Path to the readme file, markdown supported.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-logo+ADw-/td+AD4
+ADw-td+AD4-No+ADw-/td+AD4
+ADw-td+AD4-Path to the package logo file, transparent PNG is recommended.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-tr+AD4
+ADw-td+AD4-dependencies+ADw-/td+AD4
+ADw-td+AD4-No+ADw-/td+AD4
+ADw-td+AD4-List of dependencies required by the plugin.+ADw-/td+AD4
+ADw-/tr+AD4
+ADw-/tbody+AD4
+ADw-/table+AD4
+ADw-p+AD4-Here???s an example of the ???deployment.json??? file for the WordPress plugin we created in the previous article:+ADw-/p+AD4
+ADw-pre+AD4Aew
??+ACI-name+ACI : +ACI-wordpress+ACI,
??+ACI-display+AF8-name+ACI : +ACI-WordPress+ACI,
??+ACI-version+ACI : +ACI-1.0.0+ACI,
??+ACI-type+ACI: +AFsAIg-zray+ACIAXQ,
??+ACI-eula+ACI: +ACI-EULA.txt+ACI,
??+ACI-readme+ACI: +ACI-README.txt+ACI,
??+ACI-logo+ACI: +ACI-logo.png+ACI,
??+ACI-dependencies+ACI: +AHs
??????+ACI-plugin+ACI: +AHs
??????????????+ACI-min+ACI: +ACI-1.0+ACI,
??????????????+ACI-max+ACI: +ACI-2.0+ACI
??????+AH0,
??????+ACI-php+ACI: +AHs
??????????????+ACI-min+ACI: +ACI-2.7.0+ACI
??????+AH0,
??????+ACI-zendservercomponent+ACI: +AFsAew
??????????????+ACI-name+ACI: +ACI-Zend Monitor+ACI
??????+AH0AXQ,
??????+ACI-extension+ACI: +AFsAew
??????????????+ACI-name+ACI: +ACI-oci8+ACI,
??????????????+ACI-equals+ACI: +ACI-2.0.8+ACI
??????+AH0, +AHs
??????????????+ACI-name+ACI: +ACI-gd+ACI
??????+AH0AXQ,
??????+ACI-directive+ACI: +AFsAew
??????????????+ACI-name+ACI: +ACI-bcmath.scale+ACI,
??????????????+ACI-equals+ACI: +ACI-0+ACI
??????+AH0AXQ
??+AH0
+AH0APA-/pre+AD4
+ADw-p+AD4-The plugin file structure would look something like this:+ADw-/p+AD4
+ADw-pre+AD4-Plugin

+AHw—–Z-Ray

+AHw—–zray.php

+AHw—–Other files

+AHw—–Route

+AHw—–route.php

+AHw—–logo.png

+AHw—–readme.md

+AHw—–eula.txt

+AHw—-deployment.json
+ADw-/pre+AD4
+ADw-h1+AD4-Step 2 : Deploying your Plugin+ADw-/h1+AD4
+ADw-p+AD4-Once your plugin package is ready, all you have to do is compress it into a .ZIP file and it???s ready to be either deployed in Zend Server or submitted to the Zend Server gallery.+ADw-/p+AD4
+ADw-p+AD4APA-b+AD4-To deploy the plugin in Zend Server:+ADw-/b+AD4APA-/p+AD4
+ADw-ol+AD4
+ADw-li+AD4-Access the Zend Server UI, and go to the +ADw-b+AD4-Plugins +AHw Manage Plugins+ADw-/b+AD4 page.+ADw-/li+AD4
+ADw-li+AD4-Click the +ADw-strong+AD4-Deploy Plugin+ADw-/strong+AD4 button, and complete the deployment steps as described +ADw-a href+AD0AIg-http://files.zend.com/help/Zend-Server/zend-server.htm+ACM-deploying+AF8-a+AF8-plugin.htm+ACIAPg-here+ADw-/a+AD4.+ADw-/li+AD4
+ADw-/ol+AD4
+ADw-p+AD4-Once your plugin is deployed, you can manage it using Zend Server???s management features.+ADw-/p+AD4
+ADw-h1+AD4-Step 3 : Submitting your Plugin to the Gallery+ADw-/h1+AD4
+ADw-p+AD4-So, you???ve tested your plugin, and feel you???re at a stage where you???d like to share the goodness with the entire community? It???s time to submit your plugin to the Zend Server Plugin Gallery+ACE By the way, ??if you do this before the 1st of Sep, you+ACYAIw-8217+ADs-ll be automatically participating in the Zend??+ADw-a href+AD0AIg-https://www.zend.com/en/products/server/plugins/plugin-contest+ACIAPg-plugin contest+ADw-/a+AD4.+ADw-/p+AD4
+ADw-p+AD4-But before we can publish your plugin and make it available for other Zend Server users in the Gallery, we need to get the plugin ready and test it. To do all this, we need some related data and information about the plugin first.+ADw-/p+AD4
+ADw-p+AD4-To submit this information to us, all you have to do is fill out +ADw-a href+AD0AIg-https://docs.google.com/forms/d/1xe9OGIM5Lc-x4YQG-QPrWFdRJFA+AF8-0GD6iBAaT33Hqjo/viewform+ACIAPg-this form+ADw-/a+AD4.+ADw-/p+AD4
+ADw-p+AD4-Once the information is verified, the plugin will be uploaded to the Gallery and you???ll receive a notification.+ADw-/p+AD4
+ADw-p+AD4-That???s all there is to it+ACEAPA-/p+AD4
+ADw-p+AD4-The next article in the series will describe how to develop the second type of Zend Server plugins +ACYAIw-8211+ADs a route plugin.+ADw-/p+AD4
+ADw-p+AD4-The post +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com/6246/develop-your-first-zend-server-plugin-part-2/+ACIAPg-Develop Your First Zend Server Plugin +ACYAIw-8211+ADs Part 2+ADw-/a+AD4 appeared first on +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com+ACIAPg-Zend Developer Zone+ADw-/a+AD4.+ADw-/p+AD4
+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/PHPDevZone/+AH4-4/1Dy+AF8-CSL4CWs+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Develop Your First Zend Server Plugin – Part 2

Murdering Auntie: ‘Top Gear’ presenters going to Amazon doesn’t mean we should kill the BBC

+ADw-img width+AD0AIg-520+ACI height+AD0AIg-245+ACI src+AD0AIg-http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2015/07/SaveTheBBCfeat-520×245.gif+ACI alt+AD0AIg-SaveTheBBCfeat+ACI title+AD0AIg-Murdering Auntie: ‘Top Gear’ presenters going to Amazon doesn’t mean we should kill the BBC+ACI data-id+AD0AIg-904772+ACI /+AD4APA-br /+AD4-If Auntie ??? the affectionate nickname given to the BBC ??? was a real auntie, The Daily Telegraph (for which I used to write) and the rest of the British right-wing press would characterise her as a feckless benefit cheat who has been sponging off the state for far too long. They care not one jot for her creativity or unique place in British life. And the licence fee, which pays to keep the BBC running as well as being sliced up for other services ??? some goes into broadband provision, some to Channel 4 and others ??? is the+ACYAIw-8230+ADs +ADw-br /+AD4APA-br /+AD4APA-a href+AD0AIg-http://thenextweb.com/media/2015/07/31/i-still-love-you-auntie/?utm+AF8-source+AD0-social+ACY-amp+ADs-utm+AF8-medium+AD0-feed+ACY-amp+ADs-utm+AF8-campaign+AD0-profeed+ACIAPg-This story continues+ADw-/a+AD4 at The Next Web+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/TheNextWebUk/+AH4-4/gogoPALjysk+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Murdering Auntie: ‘Top Gear’ presenters going to Amazon doesn’t mean we should kill the BBC

Debugging PHP Web Apps in a Docker Container

+ADw-p+AD4-Debugging is an essential task of software development in any programming language. Unfortunately, the out-of-the-box experience with debugging in PHP is not always great. The ???stock??? PHP binaries available at +ADw-a href+AD0AIg-http://php.net/+ACIAPg-php.net+ADw-/a+AD4 do not come configured with either of the two popular debug servers Xdebug and Zend Debugger. Developers are required to do additional configuration to make debugging possible with their PHP stack. This can be a significant hurdle for developers who are new to PHP.+ADw-/p+AD4
+ADw-p+AD4-Alternatively, developers can use a professional PHP stack like +ADw-a href+AD0AIg-http://www.zend.com/en/products/zend+AF8-server+ACIAPg-Zend Server+ADw-/a+AD4, which comes configured with both Xdebug and Zend Debugger.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-https://www.docker.com/+ACIAPg-Docker+ADw-/a+AD4, a technology that???s all the rage these days, provides another possible solution +ACYAIw-8211+ADs debug your PHP web app in a Docker container, created from a predefined image of a PHP stack with a debug server. These predefined images are available in the +ADw-a href+AD0AIg-https://registry.hub.docker.com/search?q+AD0-library+ACIAPg-Docker Hub+ADw-/a+AD4. Developers with basic understanding of Docker can use the technology to debug their PHP web apps without the need to know how to install and configure a debug server in their PHP stack.+ADw-/p+AD4
+ADw-p+AD4-Below is a comprehensive walkthrough of pulling an appropriate image from Docker Hub, running a container and then debugging PHP code on it. The walkthough uses the +ADw-a href+AD0AIg-http://www.zend.com/en/products/studio/studio-early-access+ACIAPg-Zend Studio 13 Early Access+ADw-/a+AD4, which introduces the new +ADw-a href+AD0AIg-https://wiki.eclipse.org/Linux+AF8-Tools+AF8-Project/Docker+AF8-Tooling/User+AF8-Guide+ACIAPg-Docker Tooling+ADw-/a+AD4.+ADw-/p+AD4
+ADw-p+AD4APA-em+AD4-Note.+ADw-/em+AD4 The scenario described is still possible with earlier versions of +ADw-a href+AD0AIg-http://www.zend.com/en/products/studio+ACIAPg-Zend Studio+ADw-/a+AD4, but any Docker management operations would need to be executed in a command terminal.+ADw-/p+AD4
+ADw-h2+AD4-1. Install the Docker Engine on the Operating System+ADw-/h2+AD4
+ADw-p+AD4-The first prerequisite is to install and configure the Docker Engine. We need it to be able to pull images from Docker Hub and to run the container. The Docker web site provides a comprehensive +ADw-a href+AD0AIg-https://docs.docker.com/installation/+ACIAPg-installation guide+ADw-/a+AD4 for each operating system.+ADw-/p+AD4
+ADw-h2+AD4-2. Install the Docker Support in Zend Studio+ADw-/h2+AD4
+ADw-p+AD4-Once we have the Docker Engine installed, we need to have the Docker Tooling installed in Zend Studio. It is available as a an extra feature and can be found under the Enhancements category on the Welcome screen.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-install.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6391 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-install.png+ACI alt+AD0AIg-Zend Studio Docker Support Installation+ACI width+AD0AIg-729+ACI height+AD0AIg-254+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-After restarting Zend Studio, we can switch to the Docker Tooling perspective. This new perspective has several views for managing Docker images and containers:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Docker Explorer +ACYAIw-8211+ADs view for creating/managing connections to Docker daemons+ADw-/li+AD4
+ADw-li+AD4-Docker Images +ACYAIw-8211+ADs view for managing Docker images+ADw-/li+AD4
+ADw-li+AD4-Docker Containers +ACYAIw-8211+ADs view for managing Docker containers+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-perspective.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6397 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-perspective.png+ACI alt+AD0AIg-Zend Studio Docker Support Perspective+ACI width+AD0AIg-870+ACI height+AD0AIg-241+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-h2+AD4-3. Connect the Docker Tooling to the Docker Daemon+ADw-/h2+AD4
+ADw-p+AD4-Clicking on the link inside the Docker Explorer view launches the wizard for creating new Docker connection. If the Docker Engine was installed and configured correctly then no custom configuration is required. Clicking on the Test Connection button should result in a ???Success??? message. Clicking on the Finish button will establish the connection to the Docker daemon and will display it in the Docker Explorer view.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-connection.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6400 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-connection.png+ACI alt+AD0AIg-Zend Studio Docker Support Connection+ACI width+AD0AIg-380+ACI height+AD0AIg-155+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-h2+AD4-4.??Pull an Image from Docker Hub+ADw-/h2+AD4
+ADw-p+AD4-Now we need to pull an image from Docker Hub. We will use the +ADw-a href+AD0AIg-https://registry.hub.docker.com/u/tommylau/xdebug/+ACIAPg-tommylau/xdebug+ADw-/a+AD4 image, which has Apache HTTP Server, PHP and Xdebug inside. This can be done using the Pull Image tool button in the Docker Images view. It will display the Pull Image dialog where we need to enter ???tommylau/xdebug??? in the Name field. Clicking the Finish button will pull the image to the local machine. The image is quite large, so this operation can take a while. When done, the new image will be displayed in the Docker Explorer and Docker Images views.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-images.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6401 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-images.png+ACI alt+AD0AIg-Zend Studio Docker Support Images View+ACI width+AD0AIg-713+ACI height+AD0AIg-162+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-h2+AD4-5. Run a Docker Container from the Image+ADw-/h2+AD4
+ADw-p+AD4-We have the Docker image on our local system. Now we need to launch a Docker container out of it and map the HTTP port of the container???s Apache server to a port on our local system. We also need to map the document root of the container???s Apache server to a folder on the local system. These mappings are essential for debugging PHP code on the Docker container.+ADw-/p+AD4
+ADw-p+AD4-Creating a container is done by selecting the tommylau/xdebug image in the Docker Image view and then clicking on the Run Image tool button. There are a couple of important settings we need to do in the wizard that will pop up:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Map the HTTP port of the container???s Apache server to a port on our local system:
+ADw-ol+AD4
+ADw-li+AD4-Deselect the +ACYAIw-8220+ADs-Publish all exposed ports to random ports on the host interfaces+ACYAIw-8221+ADs checkbox.+ADw-/li+AD4
+ADw-li+AD4(Don???t miss this one+ACE) Select the checkbox of the first row in the table below (Container Port 80).+ADw-/li+AD4
+ADw-li+AD4-Click on the Edit+ACYAIw-8230+ADs button+ADw-/li+AD4
+ADw-li+AD4-Set the Host Port to some free port on the local machine, e.g. 8080.+ADw-/li+AD4
+ADw-li+AD4-Click the OK button to close the Exposing a Container Port dialog.+ADw-/li+AD4
+ADw-/ol+AD4
+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-container-port.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6403 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-container-port.png+ACI alt+AD0AIg-Zend Studio Docker Support Port Mapping+ACI width+AD0AIg-613+ACI height+AD0AIg-163+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Map the document root of the container???s Apache server to a folder on the local system:
+ADw-ol+AD4
+ADw-li+AD4-Click on the Next button to advance to the second wizard page.+ADw-/li+AD4
+ADw-li+AD4-Click on the Add button of the Data Volumes group.+ADw-/li+AD4
+ADw-li+AD4-Enter +ACYAIw-8220+ADs-/var/www/html+ACYAIw-8221+ADs as Container Path.+ADw-/li+AD4
+ADw-li+AD4-Select the +ACYAIw-8220+ADs-Mount a host directory or host file+ACYAIw-8221+ADs radio box.+ADw-/li+AD4
+ADw-li+AD4-Click on the Directory button and browse some empty directory on the local file system, e.g. /home/raev/www+ADw-/li+AD4
+ADw-li+AD4-Click on the OK button to close Data Volume dialog.+ADw-/li+AD4
+ADw-li+AD4(Don???t miss this one+ACE) Select the checkbox of the newly added data volume in the table.+ADw-/li+AD4
+ADw-/ol+AD4
+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-container-volume.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6404 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-container-volume.png+ACI alt+AD0AIg-Zend Studio Docker Support Volume Mapping+ACI width+AD0AIg-613+ACI height+AD0AIg-263+ACI /+AD4APA-/a+AD4APA-br /+AD4
Clicking on the Finish button will start the Docker container. It will appear in the Docker Explorer and Docker Containers views. Startup logs can be seen in the Console view.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-containers.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6405 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-containers.png+ACI alt+AD0AIg-Zend Studio Docker Support Containers View+ACI width+AD0AIg-730+ACI height+AD0AIg-163+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-We can test if the container is working by requesting the HTTP port of the container we mapped to the local system, i.e. requesting +ADw-a href+AD0AIg-http://localhost:8080+ACIAPg-http://localhost:8080+ADw-/a+AD4 in a web browser. The browser should display a ???Forbidden??? page. This is OK because this is how the Apache server is configured in the Docker image we used. This error is actually a proof that the web browser requested the Apache server running in our Docker container. Additional access logs are printed in the Console view.+ADw-/p+AD4
+ADw-p+AD4APA-img class+AD0AIg size-full wp-image-6408 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-console.png+ACI alt+AD0AIg-Zend Studio Docker Support Console View+ACI width+AD0AIg-977+ACI height+AD0AIg-148+ACI /+AD4APA-/p+AD4
+ADw-h2+AD4-6.??Configure a PHP Server to Represent the Docker Container+ADw-/h2+AD4
+ADw-p+AD4-Now we need to configure the PHP tooling in Zend Studio to run and debug PHP code in the our Docker container. The PHP tooling uses the abstraction of PHP Servers as the environment of deploying, running and debugging PHP code. Therefore, we need to create a new PHP Server entity in Zend Studio that represents our Docker container. So, we need to switch to the PHP perspective and click the Add tool button on the PHP Servers view. In the PHP Server Creation wizard we have to select the Generic PHP Server view and make the following settings on the next wizard page:+ADw-/p+AD4
+ADw-ol+AD4
+ADw-li+AD4-Give some name in the Server Name field, e.g. +ACYAIw-8220+ADs-Docker Xdebug+ACYAIw-8221+ADs.+ADw-/li+AD4
+ADw-li+AD4-Set the Base URL to +ACYAIw-8220+ADs-http://localhost:8080+ACYAIw-8243+ADs, where 8080 is the port we used to map the container???s HTTP port to the local system.+ADw-/li+AD4
+ADw-li+AD4-Set the Document Root to the folder we used to map the container???s document root to the local file system.+ADw-/li+AD4
+ADw-/ol+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-server.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6409 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-server.png+ACI alt+AD0AIg-Zend Studio Docker Support PHP Server Configuration+ACI width+AD0AIg-609+ACI height+AD0AIg-154+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-On the next wizard page, we must configure the debugger settings of the server. Select +ACYAIw-8220+ADs-XDebug+ACYAIw-8221+ADs in the Debugger drop-down list. We choose this option because the Docker image we pulled from Docker Hub has Xdebug preconfigured. If we use another image where Zend Debugger is preconfigured then we should choose the ???Zend Debugger??? option, or ???+ACY-lt+ADs-none+ACY-gt+ADs??? in case the image has no PHP debug server preconfigured. Clicking on the Finish button creates the new PHP server and displays it in the PHP Servers view.+ADw-/p+AD4
+ADw-h2+AD4-7. Create a PHP Project with Some Code+ACY-gt+ADsAPA-/h2+AD4
+ADw-p+AD4-Now, let???s create some PHP code+ACE We need a new project. It can be created by calling New +ACY-gt+ADs File +ACY-gt+ADs Local PHP Project from the main menu. In the displayed wizard we must make sure that the project is targeted on the PHP server we???ve just created and the project???s location points to the PHP server???s document root.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-project.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6410 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-project.png+ACI alt+AD0AIg-Zend Studio Docker Support PHP Project Configuration+ACI width+AD0AIg-589+ACI height+AD0AIg-158+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-After creating the project we can place some code in the index.php file. Even a simple printing of ???Hello World+ACE??? would be enough.+ADw-/p+AD4
+ADw-h2+AD4-8. Debug It+ACEAPA-/h2+AD4
+ADw-p+AD4-Now let???s debug it. Right-clicking on the index.php file and choosing Debug As +ACY-gt+ADs PHP Web Application will request the web application in the Zend Studio internal browser and will connect the Zend Studio debug client to the Xdebug server running in the Docker container. You can see the execution breaks on the first line of index.php and a dialog pops up to propose switching to the Debug perspective.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-debug.png+ACIAPgA8-img class+AD0AIg size-full wp-image-6412 aligncenter+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/studio-docker-debug.png+ACI alt+AD0AIg-Zend Studio Docker Support Debugging+ACI width+AD0AIg-1009+ACI height+AD0AIg-676+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-We can call this a success+ACEAPA-/p+AD4
+ADw-h2+AD4-Conclusion+ADw-/h2+AD4
+ADw-p+AD4-In this article we have seen how we can use predefined Docker images to setup complex PHP stack environments and use Zend Studio and??its new Docker support to develop, run and debug PHP code on them.+ADw-/p+AD4
+ADw-p+AD4APA-em+AD4-Note.+ADw-/em+AD4 You can also use the +ADw-a href+AD0AIg-https://registry.hub.docker.com/u/zend/php-zendserver/+ACIAPg-zend/php-zendserver+ADw-/a+AD4 Docker image that comes with a completely installed and configured Zend Server.+ADw-/p+AD4
+ADw-p+AD4-The post +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com/6385/zend-studio-docker-support/+ACIAPg-Debugging PHP Web Apps in a Docker Container+ADw-/a+AD4 appeared first on +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com+ACIAPg-Zend Developer Zone+ADw-/a+AD4.+ADw-/p+AD4
+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/PHPDevZone/+AH4-4/oHE-earH5q8+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Debugging PHP Web Apps in a Docker Container

Z-Ray for Concrete5

+ADw-p+AD4-Hi guys. Zend Server 8.5 was announced a bit more than a??week ago, and we+ACYAIw-8217+ADs-ve already seen??two new plugins developed by the community added to the Zend Gallery. In this article I+ACYAIw-8217+ADs-d like to introduce you to one of them +ACYAIw-8211+ADs the concrete5 Z-Ray plugin developed by Andrew Embler (+ADw-a href+AD0AIg-https://twitter.com/aembler+ACIAPgBA-aembler+ADw-/a+AD4).+ADw-/p+AD4
+ADw-p+AD4-First, and as a short reminder to those new to the concept of Zend Server plugins +ACYAIw-8211+ADs plugins are basically pieces of code that extend Zend Server+ACYAIw-8217+ADs-s functionality in a variety of ways. Z-Ray plugins??result in adding specific information in Z-Ray on the app/framework/platform you+ACYAIw-8217+ADs-re developing.+ADw-/p+AD4
+ADw-p+AD4-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 +ACYAIw-8211+ADs also for +ADw-a href+AD0AIg-http://www.concrete5.org/+ACIAPg-concrete5+ADw-/a+AD4.+ADw-/p+AD4
+ADw-p+AD4APA-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/concrete5+AF8-plugin.png+ACIAPgA8-img class+AD0AIg-aligncenter size-large wp-image-6373+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/07/concrete5+AF8-plugin-1024×280.png+ACI alt+AD0AIg-concrete5+AF8-plugin+ACI width+AD0AIg-625+ACI height+AD0AIg-171+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-So, what info does this plugin give concrete5 developers?+ADw-/p+AD4
+ADw-p+AD4-Starting from left to right:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Blocks panel +ACYAIw-8211+ADs gives you a list of the current blocks on the page, including whether they were used??from the cache,??the area they came from, whether they were rendered or not, how long they took to execute, the actual content of the block, and more.+ADw-/li+AD4
+ADw-li+AD4-General panel +ACYAIw-8211+ADs provides useful general information about your concrete5 configuration, including which concrete5 version you+ACYAIw-8217+ADs-re using, which database version you+ACYAIw-8217+ADs-re using, and global caching configurations.+ADw-/li+AD4
+ADw-li+AD4-Page Requests +ACYAIw-8211+ADs displays all the page objects called by the page request, including their ID, path, name and how many times they were requested.+ADw-/li+AD4
+ADw-li+AD4-Config Requests +ACYAIw-8211+ADs shows you all the configuration variables requested by the page, including how many times they were requested and the return value.+ADw-/li+AD4
+ADw-li+AD4-Your Access Entities +ACYAIw-8211+ADs gives you information on the permissions of the current user.?? When +ADw-a href+AD0AIg-https://www.youtube.com/watch?v+AD0-tPRtLZsqkCM+ACIAPg-remotely debugging+ADw-/a+AD4 your customer+ACYAIw-8217+ADs-s requests using Z-Ray Live+ACE this could be very useful.+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-h1+AD4-Installing the Plugin+ADw-/h1+AD4
+ADw-p+AD4-The concrete5 plugin can be installed via??the Zend Gallery, from within the Zend Server UI.??Once you+ACYAIw-8217+ADs-ve accessed the UI, go to +ADw-strong+AD4-Plugins +AHw Gallery+ADw-/strong+AD4, locate the plugin and click the Install button. Complete the short deployment wizard, and you+ACYAIw-8217+ADs-ll be up and running with the new plugin in no time.+ADw-/p+AD4
+ADw-p+AD4-To start using Z-Ray and the plugin to introspect??your code, simply open your concrete5 app in a browser+ACEAPA-/p+AD4
+ADw-p+AD4-The plugin code can be found here:??+ADw-a href+AD0AIg-http://github.com/concrete5/zend-server-plugins/+ACIAPg-http://github.com/concrete5/zend-server-plugins/+ADw-/a+AD4APA-/p+AD4
+ADw-p+AD4APA-iframe src+AD0AIg-https://www.youtube.com/embed/-ccE05WwJIA+ACI width+AD0AIg-560+ACI height+AD0AIg-315+ACI frameborder+AD0AIg-0+ACI allowfullscreen+AD0AIg-allowfullscreen+ACIAPgA8-/iframe+AD4APA-/p+AD4
+ADw-h1+AD4-Develop your Own Plugin+ADw-/h1+AD4
+ADw-p+AD4-If you+ACYAIw-8217+ADs-ve got an idea for a plugin, there are some useful resources available that will help you get started:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4-Official plugin documentation:??+ADw-a href+AD0AIg-https://github.com/zend-server-plugins/Documentation+ACIAPg-https://github.com/zend-server-plugins/Documentation+ADw-/a+AD4APA-/li+AD4
+ADw-li+AD4-A brief tutorial on how to develop a Z-Ray plugin, showing how the WordPress plugin was developed +ACYAIw-8211+ADs??+ADw-a href+AD0AIg-http://devzone.zend.com/6149/develop-your-first-zend-server-plugin-part-1/+ACIAPg-Develop Your First Zend Server Plugin +ACYAIw-8211+ADs Part 1+ADw-/a+AD4APA-/li+AD4
+ADw-li+AD4-Andrew guides you through the steps he took to develop his concrete5 plugin +ACYAIw-8211+ADs??+ADw-a href+AD0AIg-http://andrewembler.com/2015/07/creating-z-ray-plugin-zend-server-85/+ACIAPg-http://andrewembler.com/2015/07/creating-z-ray-plugin-zend-server-85/+ADw-/a+AD4APA-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4-Timing is everything in life. If you+ACYAIw-8217+ADs-re quick on your feet and complete your plugin before the 1st of Sep, you+ACYAIw-8217+ADs-ll be automatically be participating in the plugin contest. Check it out here:??+ADw-a href+AD0AIg-https://www.zend.com/en/products/server/plugins/plugin-contest+ACIAPg-https://www.zend.com/en/products/server/plugins/plugin-contest+ADw-/a+AD4APA-/p+AD4
+ADw-p+AD4-The post +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com/6364/z-ray-for-concrete5/+ACIAPg-Z-Ray for Concrete5+ADw-/a+AD4 appeared first on +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com+ACIAPg-Zend Developer Zone+ADw-/a+AD4.+ADw-/p+AD4
+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/PHPDevZone/+AH4-4/ZFGHLMgEv24+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Z-Ray for Concrete5

Apigility 1.3.1 Released!

+ADw-p+AD4-We+ACYAIw-8217+ADs-ve just released Apigility 1.3.1, which you can download from the Apigility website:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://apigility.org/download+ACIAPg-https://apigility.org/download+ADw-/a+AD4APA-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4-If you are already using Apigility, you can update your project using +ADw-a href+AD0AIg-https://getcomposer.org+ACIAPg-Composer+ADw-/a+AD4:+ADw-/p+AD4
+ADw-pre+AD4APA-code class+AD0AIg-language-bash+ACIAPgAk composer update+ADw-/code+AD4APA-/pre+AD4
+ADw-p+AD4-This release fixes a few minor issues discovered following the 1.3.0 release, as well as fixes a security vulnerability.+ADw-/p+AD4
+ADw-h2+AD4-Security Fix+ADw-/h2+AD4
+ADw-p+AD4-A security vulnerability was reported against +ADw-a href+AD0AIg-https://github.com/zfcampus/zf-oauth2+ACIAPg-zf-oauth2+ADw-/a+AD4, with a potential user spoofing vector when using the web application (aka authorization token) scenario. Visit the Zend Framework security advisory for more details:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4APA-a href+AD0AIg-http://framework.zend.com/security/advisory/AG2015-01+ACIAPg-http://framework.zend.com/security/advisory/AG2015-01+ADw-/a+AD4APA-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4-If you are using zf-oauth2 in your application, and using the authorization code scenario, you can update it specifically:+ADw-/p+AD4
+ADw-pre+AD4APA-code class+AD0AIg-language-bash+ACIAPgAk composer update zfcampus/zf-oauth2+ADw-/code+AD4APA-/pre+AD4
+ADw-h3+AD4-Bug Fixes+ADw-/h3+AD4
+ADw-p+AD4-In addition to the security fix, we patched a number of other issues.+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://github.com/zfcampus/zf-oauth2/pull/112+ACIAPg-zfcampus/zf-oauth2+ACM-112+ADw-/a+AD4 fixes a parse error in the receive code template, and updates the cURL examples on that page to use the current request scheme. +ADw-/li+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://github.com/zfcampus/zf-mvc-auth/pull/94+ACIAPg-zfcampus/zf-mvc-auth+ACM-94+ADw-/a+AD4 fixes HTTP authentication to ensure that omitting an +ADw-code+AD4-Authorization+ADw-/code+AD4 header no longer results in a 401 status, and instead falls back to using the +ADw-code+AD4-GuestIdentity+ADw-/code+AD4 as it did prior to 1.1.0. +ADw-/li+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://github.com/zfcampus/zf-apigility-admin/pull/305+ACIAPg-zfcampus/zf-apigility-admin+ACM-305+ADw-/a+AD4 and +ADw-a href+AD0AIg-https://github.com/zfcampus/zf-apigility-admin-ui/pull/69+ACIAPg-zfcampus/zf-apigility-admin-ui+ACM-69+ADw-/a+AD4 allow DB adapters that do not support metadata features to be used for DB-Connected REST services. +ADw-/li+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://github.com/zfcampus/zf-apigility-skeleton/pull/105+ACIAPgAj-105+ADw-/a+AD4 updates the Vagrant setup to ensure it includes PHP 5.6, allowing it to work with versions 1.3.+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-p+AD4-The post +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com/6377/apigility-1-3-1-released/+ACIAPg-Apigility 1.3.1 Released+ACEAPA-/a+AD4 appeared first on +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com+ACIAPg-Zend Developer Zone+ADw-/a+AD4.+ADw-/p+AD4
+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/PHPDevZone/+AH4-4/mvN2w7xuDds+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Apigility 1.3.1 Released!

Don’t know how much money to take on holiday? This iOS and Android app will tell you

+ADw-img width+AD0AIg-520+ACI height+AD0AIg-245+ACI src+AD0AIg-http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2015/07/Screenshot-2015-07-22-10.28.10-520×245.png+ACI alt+AD0AIg-Screenshot 2015-07-22 10.28.10+ACI title+AD0AIg-Don’t know how much money to take on holiday? This iOS and Android app will tell you+ACI data-id+AD0AIg-902109+ACI /+AD4APA-br /+AD4-Apparently, 50??percent of British people don???t know how to budget when they travel abroad. But, consider this, the survey was conducted by Travelex, the foreign exchange company, which coincidentally??has an app to hawk. The company only surveyed 2,000 travellers to come up with its figures but, despite the relatively small sample, the app that has sprung from the thinking is a pretty good idea. The company claims the??Travelex Money App??(free on??Android and iOS)?? ??? nice, simple name there ??? will ???ease the stress??? of deciding how much money to spend abroad. The trick is that it shows you how much+ACYAIw-8230+ADs +ADw-br /+AD4APA-br /+AD4APA-a href+AD0AIg-http://thenextweb.com/apps/2015/07/22/cash-rules-everything-around-me-cream-holiday-money/?utm+AF8-source+AD0-social+ACY-amp+ADs-utm+AF8-medium+AD0-feed+ACY-amp+ADs-utm+AF8-campaign+AD0-profeed+ACIAPg-This story continues+ADw-/a+AD4 at The Next Web+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/TheNextWebUk/+AH4-4/SGD7aPVZt1s+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Don’t know how much money to take on holiday? This iOS and Android app will tell you

No, you won’t be fined for using Apple Pay on a London bus or train

+ADw-img width+AD0AIg-520+ACI height+AD0AIg-245+ACI src+AD0AIg-http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2015/06/apple-pay-reader-520×245.jpg+ACI alt+AD0AIg-apple pay reader+ACI title+AD0AIg-No, you won’t be fined for using Apple Pay on a London bus or train+ACI data-id+AD0AIg-883281+ACI /+AD4APA-br /+AD4-With all the furore around the launch of Apple Pay in the UK last week, it was bound to throw up the odd problem or two. However, if you spotted Expert Reviews??? report that suggests that Transport for London (TfL) may fine you simply for paying for your trip with Apple Pay, then rest easy. That???s incorrect. The report says??that ???ticket inspectors??? (who now bear the even friendlier title of ???revenue inspection??officers???) don???t have the technology to check whether passengers??? tickets if they paid via contactless devices, but could if payment was via contactless cards. And if you??can???t prove you+ACYAIw-8230+ADs +ADw-br /+AD4APA-br /+AD4APA-a href+AD0AIg-http://thenextweb.com/apple/2015/07/20/no-you-wont-be-fined-for-using-apple-pay-on-a-london-bus-or-train/?utm+AF8-source+AD0-social+ACY-amp+ADs-utm+AF8-medium+AD0-feed+ACY-amp+ADs-utm+AF8-campaign+AD0-profeed+ACIAPg-This story continues+ADw-/a+AD4 at The Next Web+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/TheNextWebUk/+AH4-4/zDR99QUQfWQ+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : No, you won’t be fined for using Apple Pay on a London bus or train

Develop Your First Zend Server Plugin – Part 1

+ADw-p+AD4-Zend Server 8.5 introduces a brand-new concept called ???Plugins???. This concept is centered around the Zend Gallery +ACYAIw-8211+ADs a marketplace for plugins that extend Zend Server functionality, and that were developed by, and for, the Zend Server user community.+ADw-/p+AD4
+ADw-p+AD4-What are plugins? Put simply, plugins are pieces of code that can extend Zend Server in either, or both, of the following two ways: they can add panels to Z-Ray, thus displaying additional information about your environment that you want shown, or +ACYAIw-8211+ADs they can define the routing logic for your application???s requests. This plugin type helps Zend Server aggregate monitoring events, and display improved results for URLs listed in URL Insight.+ADw-/p+AD4
+ADw-p+AD4-In this article, the first in a series of articles describing Zend Server plugin development, you???ll be reading how to write a Z-Ray plugin for WordPress. This plugin extracts and displays a list of loaded WordPress plugins, and is based on the official Z-Ray WordPress plugin that???s bundled with Zend Server. While just an example, it does well to articulate the main constructs plugins Z-Ray plugins include.+ADw-/p+AD4
+ADw-p+AD4-All the documentation you need to learn how to build a plugin for Z-Ray is detailed on +ADw-a href+AD0AIg-https://github.com/zend-server-plugins/Documentation+ACIAPg-GitHub+ADw-/a+AD4.+ADw-/p+AD4
+ADw-p+AD4APA-b+AD4-Note:+ADw-/b+AD4 You will be provided with code snippets throughout this tutorial.??You can download the entire plugin +ADw-a href+AD0AIg-http://www.zend.com/marketing/zend-server/plugins/wordpress-plugin.zip+ACIAPg-here+ADw-/a+AD4.+ADw-/p+AD4
+ADw-h2+AD4-Prerequisites+ADw-/h2+AD4
+ADw-p+AD4-To follow the steps in this tutorial, you will need to do the following:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4APA-a href+AD0AIg-http://www.zend.com/en/downloads+ACIAPg-Download+ADw-/a+AD4, +ADw-a href+AD0AIg-http://files.zend.com/help/Zend-Server/zend-server.htm+ACM-installation+AF8-guide.htm+ACIAPg-install+ADw-/a+AD4, and +ADw-a href+AD0AIg-http://files.zend.com/help/Zend-Server/zend-server.htm+ACM-launching+AF8-zend+AF8-server.htm+ACIAPg-launch +ADw-/a+AD4-Zend Server 8.5 and above+ADw-/li+AD4
+ADw-li+AD4-Move the existing built-in WordPress plugin located at:
+ADw-ul+AD4
+ADw-li+AD4-Mac and Linux: /usr/local/zend/var/plugins/wordpress+ADw-/li+AD4
+ADw-li+AD4-Windows: C:+AFw-Program Files (x86)+AFw-Zend+AFw-ZendServer+AFw-data+AFw-plugins+AFw-wordpress+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-/li+AD4
+ADw-li+AD4APA-a href+AD0AIg-https://www.youtube.com/watch?v+AD0-xaO1tRTj3gk+ACIAPg-Install WordPress on Zend Server+ADw-/a+AD4.+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-h2+AD4-Step 1 : Creating your Plugin Folder and the ???zray.php??? File+ADw-/h2+AD4
+ADw-p+AD4-Your first step is to go to the Z-Ray Plugins folder in your Zend Server installation files (see the file path in the Prerequisites above), and create a new folder with the name of your plugin.+ADw-/p+AD4
+ADw-p+AD4-Within this folder, create another folder called ???Z-Ray??? +ACYAIw-8211+ADs this folder will hold the Z-Ray plugin files.+ADw-/p+AD4
+ADw-p+AD4-In this folder, we???re going ??to create a new PHP file called ???zray.php???. This file is the plugin+ACYAIw-8217+ADs-s??include file, and it???s good practice to have it in the root of the plugin directory.+ADw-/p+AD4
+ADw-p+AD4-Here???s a simple diagram to portray the plugin structure we???ve just created:+ADw-/p+AD4
+ADw-pre+AD4-var/plugins
+AHw—WordPress
+AHw—Z-Ray
+AHw—zray.php+ADw-/pre+AD4
+ADw-h2+AD4-Step 2 : Declaring the New Plugin+ADw-/h2+AD4
+ADw-p+AD4-In the newly created ???zray.php??? file, you???re now going to enter a class for declaring the new plugin:+ADw-/p+AD4
+ADw-pre+AD4AJA-zre +AD0 new ZRayExtension(‘WordPress’)+ADsAPA-/pre+AD4
+ADw-p+AD4-This class is the main API for defining all the plugin???s trace actions and metadata.+ADw-/p+AD4
+ADw-h2+AD4-Step 3 : Enabling the Plugin+ADw-/h2+AD4
+ADw-p+AD4-Next, you???re going to enable the plugin.+ADw-br /+AD4
To do this, we???re going to enter the following expression:+ADw-/p+AD4
+ADw-pre+AD4AJA-zre-+ACY-gt+ADs-setEnabledAfter (???wp+AF8-initial+AF8-constants???)+ADsAPA-/pre+AD4
+ADw-p+AD4-We???re basically telling Z-Ray to load the plugin after the ???wp+AF8-initial+AF8-constants??? method is called. Since this is the first WordPress function that???s called on a page, it???s the perfect trigger to use.+ADw-/p+AD4
+ADw-h2+AD4-Step 4 : Declaring a Trace+ADw-/h2+AD4
+ADw-p+AD4-The next part is to declare a trace on a particular function. This is the main functional part of the plugin as it defines the function to be traced and the data to be displayed in Z-Ray.+ADw-br /+AD4
The declaration includes the name of the function to be traced, and two callables which are fired when entering and exiting the function. Something along the lines of:+ADw-/p+AD4
+ADw-pre+AD4-//General pattern of the trace function
+ACQ-zre-+ACY-gt+ADs-traceFunction(+ACQ-pattern, +ACQ-onenter, +ACQ-onleave)+ADsAPA-/pre+AD4
+ADw-p+AD4-In our case, we???re going to use the +ACYAIw-8216+ADs-wp+AF8-cache+AF8-close+ACYAIw-8217+ADs function since we know this is a good time to retrieve a??list of WordPress plugins.+ADw-br /+AD4
We can??leave the entry callable empty, but we???re going to develop the exit callable a bit.+ADw-br /+AD4
First, we???re going to add two parameters that the traceFunction callable method accepts:+ADw-/p+AD4
+ADw-ul+AD4
+ADw-li+AD4AJA-context is an array of information about the function+ADw-/li+AD4
+ADw-li+AD4AJA-storage is a reference to the storage array, and is used to store the info that will actually be displayed in Z-Ray.+ADw-/li+AD4
+ADw-/ul+AD4
+ADw-pre+AD4AJA-zre-+ACY-gt+ADs-traceFunction(‘wp+AF8-cache+AF8-close’, function() +AHsAfQ, function(+ACQ-context, +ACY-amp+ADsAJA-storage))+ADsAPA-/pre+AD4
+ADw-p+AD4-Next, we???re going to code what we want executed upon leaving the ???wp+AF8-cache+AF8-close??? function.+ADw-br /+AD4
So what do we want executed upon leaving the +ACYAIw-8216+ADs-wp+AF8-cache+AF8-close+ACYAIw-8217+ADs function?+ADw-br /+AD4
We???re going to start by entering the WordPress method for extracting plugin data.+ADw-/p+AD4
+ADw-pre+AD4AJA-zre-+ACY-gt+ADs traceFunction (‘wp+AF8-cache+AF8-close’, function()+AHsAfQ, function(+ACQ-context,+ACY-amp+ADsAJA-storage)+AHs
+ACQ-plugins +AD0 get+AF8-plugins()+ADs
+AH0)+ADsAPA-/pre+AD4
+ADw-p+AD4-Now, since we don???t really know what this data actually looks like, we???re going to first dump the +ACQ-plugins object in a new Z-Ray panel and check out what it looks like in Z-Ray. The way to do this is very simple:+ADw-/p+AD4
+ADw-pre+AD4AJA-zre-+ACY-gt+ADs traceFunction (‘wp+AF8-cache+AF8-close’, function()+AHsAfQ, function(+ACQ-context,+ACY-amp+ADsAJA-storage)+AHs
+ACQ-plugins +AD0 get+AF8-plugins()+ADs
+ACQ-storage+AFs’plugins+AF8-var’+AF0AWwBd +AD0 +ACQ-plugins+ADs
+AH0)+ADsAPA-/pre+AD4
+ADw-p+AD4-Let???s see what it looks like in Z-Ray. Save the file, and open WordPress in your browser.+ADw-/p+AD4
+ADw-p style+AD0AIg-text-align: center+ADsAIgA+ADw-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/pluigns+AF8-var.jpg+ACIAPgA8-img class+AD0AIg-aligncenter wp-image-6163 size-large+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/pluigns+AF8-var-1024×586.jpg+ACI alt+AD0AIg-pluigns+AF8-var+ACI width+AD0AIg-840+ACI height+AD0AIg-481+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-You???ll notice that a new top-level panel was added to Z-Ray for your plugin containing the Plugins+AF8-var panel. This panel displays a tree table with??a multi-level array. The plugin???s storage mechanism automatically generates tables based on the information stored. If an array or associative array is passed, a grid table will be created with columns as the names of the keys. If a multi-level array or an object is passed, a tree table will be created.+ADw-br /+AD4
Now, we???d like to extract only part of this information, say only the name and version of the plugin.+ADw-br /+AD4
So we???re going to enter a ???foreach??? loop with another storage execution, only this time we???re going to specify an array instead of the +ACQ-plugins object.+ADw-/p+AD4
+ADw-pre+AD4-foreach (+ACQ-plugins as +ACQ-plugin) +AHs
+ACQ-storage+AFs’plugins’+AF0AWwBd +AD0 array(
‘Name’ +AD0AJg-gt+ADs +ACQ-plugin+AFs’Name’+AF0,
‘Version’ +AD0AJg-gt+ADs +ACQ-plugin+AFs’Version’+AF0
)+ADs
+AH0APA-/pre+AD4
+ADw-p+AD4-Save the file, and refresh WordPress again.+ADw-/p+AD4
+ADw-p style+AD0AIg-text-align: center+ADsAIgA+ADw-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/pluigns.jpg+ACIAPgA8-img class+AD0AIg-aligncenter size-large wp-image-6165+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/pluigns-1024×586.jpg+ACI alt+AD0AIg-pluigns+ACI width+AD0AIg-840+ACI height+AD0AIg-481+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-You can now see a new Plugins panel with a grid view of the plugins, and with the plugin info we wanted to be displayed.+ADw-/p+AD4
+ADw-h2+AD4-Step 5 : Adding a Logo+ADw-/h2+AD4
+ADw-p+AD4-If not specified otherwise, Z-Ray plugins display the Zend logo on Z-Ray and in the plugin panels themselves. However, a nice, and very much recommended, touch to a plugin is to add your own customized logo.+ADw-br /+AD4
To do this, you???ll first need to add the logo image to the Z-Ray plugin folder containing the +ACYAIw-8216+ADs-zray.php+ACYAIw-8217+ADs file. Please note that the image should be 24X24 px, and should contain both a regular and hover state.+ADw-br /+AD4
Next, in the +ACYAIw-8216+ADs-zray.php+ACYAIw-8217+ADs??file, we???re going to use the setMetadata function. In this case, we???re going to use the unique key ???logo??? to set the default logo for the plugin. This is done by passing a full path to the logo file:+ADw-/p+AD4
+ADw-pre+AD4AJA-zre-+ACY-gt+ADs-setMetadata(array(
‘logo’ +AD0AJg-gt+ADs +AF8AXw-DIR+AF8AXw . DIRECTORY+AF8-SEPARATOR . ‘logo.png’,
))+ADsAPA-/pre+AD4
+ADw-p+AD4-Save, and refresh WordPress.+ADw-/p+AD4
+ADw-p style+AD0AIg-text-align: center+ADsAIgA+ADw-a href+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/logo.jpg+ACIAPgA8-img class+AD0AIg-aligncenter size-large wp-image-6173+ACI src+AD0AIg-http://devzone.zend.com/wp-content/uploads/2015/06/logo-1024×303.jpg+ACI alt+AD0AIg-logo+ACI width+AD0AIg-840+ACI height+AD0AIg-249+ACI /+AD4APA-/a+AD4APA-/p+AD4
+ADw-p+AD4-How easy was that?+ADw-/p+AD4
+ADw-p+AD4-Here+ACYAIw-8217+ADs-s what your plugin code should look like at the end:+ADw-/p+AD4
+ADw-pre+AD4AJg-lt+ADs?php

+ACQ-zre +AD0 new ZRayExtension (‘WordPress’)+ADs

+ACQ-zre-+ACY-gt+ADs-setEnabledAfter (‘wp+AF8-initial+AF8-constants’)+ADs

+ACQ-zre-+ACY-gt+ADs traceFunction (‘wp+AF8-cache+AF8-close’, function()+AHsAfQ, function(+ACQ-context,+ACY-amp+ADsAJA-storage)+AHs
+ACQ-plugins +AD0 get+AF8-plugins()+ADs
+ACQ-storage+AFs’plugins+AF8-var’+AF0AWwBd +AD0 +ACQ-plugins+ADs

foreach (+ACQ-plugins as +ACQ-plugin) +AHs
+ACQ-storage+AFs’plugins’+AF0AWwBd +AD0 array(
‘Name’ +AD0AJg-gt+ADs +ACQ-plugin+AFs’Name’+AF0,
‘Version’ +AD0AJg-gt+ADs +ACQ-plugin+AFs’Version’+AF0
)+ADs
+AH0
+AH0)+ADs

+ACQ-zre-+ACY-gt+ADs-setMetadata(array(
‘logo’ +AD0AJg-gt+ADs +AF8AXw-DIR+AF8AXw . DIRECTORY+AF8-SEPARATOR . ‘logo.png’,
))+ADs

?+ACY-gt+ADsAPA-/pre+AD4
+ADw-h2+AD4-What+ACYAIw-8217+ADs-s Next?+ADw-/h2+AD4
+ADw-p+AD4-So, you???ve developed your plugin. Now what? You can install it in Zend Server to be able to manage it more easily. If you+ACYAIw-8217+ADs-d like to make your plugin available for all to use,??you can??+ADw-a href+AD0AIg-https://docs.google.com/forms/d/1xe9OGIM5Lc-x4YQG-QPrWFdRJFA+AF8-0GD6iBAaT33Hqjo/viewform+ACIAPg-submit+ADw-/a+AD4 it into the Zend Gallery (check out the +ADw-a href+AD0AIg-http://www.zend.com/en/products/server/plugins/plugin-contest+ACIAPg-Zend plugin contest+ADw-/a+AD4). Either way, you???ll need to package it up. Part 2 of this series??will deal with these aspects.+ADw-/p+AD4
+ADw-p+AD4-Hope you enjoyed the read+ACEAPA-/p+AD4
+ADw-p+AD4-The post +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com/6149/develop-your-first-zend-server-plugin-part-1/+ACIAPg-Develop Your First Zend Server Plugin +ACYAIw-8211+ADs Part 1+ADw-/a+AD4 appeared first on +ADw-a rel+AD0AIg-nofollow+ACI href+AD0AIg-http://devzone.zend.com+ACIAPg-Zend Developer Zone+ADw-/a+AD4.+ADw-/p+AD4
+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/PHPDevZone/+AH4-4/y3Kn7bO3n-A+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Develop Your First Zend Server Plugin – Part 1

Engineers meet artists: Discover the startup ecosystem in Bristol and Bath

+ADw-img width+AD0AIg-520+ACI height+AD0AIg-245+ACI src+AD0AIg-http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2015/07/bristol1-520×245.jpg+ACI alt+AD0AIg-bristol1+ACI title+AD0AIg-Engineers meet artists: Discover the startup ecosystem in Bristol and Bath+ACI data-id+AD0AIg-899392+ACI /+AD4APA-br /+AD4-While London is undoubtedly the center of gravity in the British startup and venture ecosystem, there???s plenty of no less fascinating things going on outside the M25 motorway. A good example would be the burgeoning ecosystem in Bristol and Bath, which form part of the so-called Silicon Gorge in the south west of England. The place of birth of a number of well-known??startups and tech companies,??this region shows that sustainable businesses can be built by passionate people even with limited access to VC money and acceleration programmes. Bristol and Bath, located in 10 minutes??? train ride from each other, are+ACYAIw-8230+ADs +ADw-br /+AD4APA-br /+AD4APA-a href+AD0AIg-http://thenextweb.com/eu/2015/07/18/engineers-meet-artists-startup-ecosystem-bristol-bath/?utm+AF8-source+AD0-social+ACY-amp+ADs-utm+AF8-medium+AD0-feed+ACY-amp+ADs-utm+AF8-campaign+AD0-profeed+ACIAPg-This story continues+ADw-/a+AD4 at The Next Web+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/TheNextWebUk/+AH4-4/b5UhxaG6lFQ+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : Engineers meet artists: Discover the startup ecosystem in Bristol and Bath

A rushed UK surveillance law has been struck down by the High Court

+ADw-img width+AD0AIg-520+ACI height+AD0AIg-245+ACI src+AD0AIg-http://cdn1.tnwcdn.com/wp-content/blogs.dir/1/files/2012/11/uk-flag-ree-saunders-flickr-520×245.jpg+ACI alt+AD0AIg-uk flag ree saunders flickr+ACI title+AD0AIg-A rushed UK surveillance law has been struck down by the High Court+ACI data-id+AD0AIg-507768+ACI /+AD4APA-br /+AD4-The High Court in the UK??has ruled today that part of the country???s surveillance legislation is unlawful. The??Data Retention and Investigatory Powers Act 2014 (DRIPA) was determined to be breaking the law by hindering the public???s right to a private life.?? MPs David Davis and Tom Watson brought the case to the High Court, represented by??Liberty Human Rights organization who revealed that the High Court found sections 1 and 2 of DRIPA unlawful on the basis that: ?????they fail to provide clear and precise rules to ensure data is only accessed for the purpose of preventing and detecting serious offences,+ACYAIw-8230+ADs +ADw-br /+AD4APA-br /+AD4APA-a href+AD0AIg-http://thenextweb.com/insider/2015/07/17/a-rushed-uk-surveillance-law-has-been-struck-down-by-the-high-court/?utm+AF8-source+AD0-social+ACY-amp+ADs-utm+AF8-medium+AD0-feed+ACY-amp+ADs-utm+AF8-campaign+AD0-profeed+ACIAPg-This story continues+ADw-/a+AD4 at The Next Web+ADw-img src+AD0AIg-http://feeds.feedburner.com/+AH4-r/TheNextWebUk/+AH4-4/xi5vPOdNVsA+ACI height+AD0AIg-1+ACI width+AD0AIg-1+ACI alt+AD0AIgAi /+AD4-

Read more : A rushed UK surveillance law has been struck down by the High Court

Social Media Web Tips, Social Media News & Technology Updates