knightly

Blog Archives

VMware Workstation Listen to voice of the customer

A while back i was contacted by Vijay Laxmi. Vijay is a Sr Partner Marketing Manager over at Zend Technologies. And she was interested in doing a podcast like interview about the brand new and shiny VMWare & Zend Studio integration. And because i am a big fan of this feature. I didn’t see why not. So we had a few chat sessions. Along the way Joshua Solomin from Zend and Michael Paiko from VMWare joined the party. And after some preparation we recorded the session. Considering i have never been much of a speaker. This was quite fun to do.

Michael send me the end result. And everybody seemed happy with it. After that life resumed and i have been incredibly busy every since. So i kinda forgot about the whole thing. Till Vijay mailed me today (ty! Vijay). VMWare put the recording on their website. And a customer mailing has been transmitted over the wire. Cool stuff!

2011-02-07 VMware-Zend VOC Podcast

Dark theme for Zend Studio 8

Because i was so happy with my new 3 monitor configuration. I decided to refresh my development environment as well. Normally all my files would reside in the Devspace older in my user folder under the /home directory. Now i used a new 500 GB SATA drive and formatted it EXT3. Moving your workspace in Zend Studio has the minor inconvenience that the local settings like fonts / syntax colours are lost. I still haven’t found a way to export this. So i decided to take this opportunity to create a nice new dark theme.. My friend Bart (still no blog?) was friendly enough to let me know how to export the theme related data in ZS. And was nice enough to send me his zenburn theme.

File > Export > General > Preferences

File > Import > General > Preferences

Bart’s zenburn theme:

Most developers i know don’t seem to care much about the colour of their screen and the font they use. But considering the fact that i spend an insanely amount of time behind a screen. It would be nice if this environment i am in all day put the least amount of constrained on my eyes as possible. So i choose to take time and configure this for optimal viewing pleasure. This starts with the font. For years i have been using the Envy Code font by Damien Guard inside my IDE. This all started i think with a post by Jeff Atwood It’s a great font that is extremely easy to read even for terminals. Although still in beta. I advice people to use it when possible.

The second thing i configure are the colour schemes my IDE uses. The standard colour always has a white background. White makes sure things are clear. But staring at a white screen for more then 6 hours always resulted in headaches for me. So the darker the better. And with a dark background you are forced to change the rest as well.

Changing the font is first

General > Appearance > Colors and Fonts
Font : Envy Code R Bold (11 pt)

Second up are some general text editor colours

General > Editors > Text Editors
Line number foreground : #787878 (120, 120, 120)
Current line highlight : #35353D (53, 53, 61)
Background color : #25252D (37, 37, 45)

And finally the PHP syntax coloring

PHP > Editor > Syntax Coloring
Decprecated : #000 (0, 0, 0)
Fields : #FFFFFF (255, 255, 255)
Heredoc : #008282 (0, 130, 130)
Keyword : #DE5727 (222, 87, 39)
Multi-line comment : #557F5F (85, 127, 95)
Normal : #FFF (255, 255, 255)
Number : #FFCECE (255, 206, 206)
PHP tags : #DE5727 (222, 87, 39)
PHP Doc : #FEC601 (254, 198, 1)
PHPDoc Comment : #FEC601 (254, 198, 1)
single line comment : #FEC601 (254, 198, 1)
static fields : #FFFFFF (255, 255, 255)
static methods : #FFFFFF (255, 255, 255)
String : #B3C0C8 (179, 192, 200)
Task Tags : #FEC601 (254, 198, 1)
Variable : #0B91B7 (11, 145, 183)

The result can be viewed below

There are much more configuration options to do but for now this is what i came up with. Setting up the theme is a since in ZS. But one thing bothered me. The function / property name highlighting when you select an element inside the IDE. Was a very light colour. And this made it impossible to read the contents of the selection.

So after searching for a while and setting every possible setting in the configuration tabs. I finally figured out how the set the colour for these two actions. This is done from the Annotations setting in the Text editors panel under the general tab. The two options to change are PHP elements read / write occurrences.

For now i settled with a dark colour. But maybe i will change this in the future since it is not very readable

That’s it for now. This of course only sets up the PHP environment. The syntax colours for XML, HTML, CSS and Javascript still have to be changed. But i will leave it at this.

Zend Studio goes virtual

Zend Studio added a new great feature to there already impressive stack of features. The IDE just keeps growing in the right direction.

So the new 8 version which at the time of writing is in Beta added VMWare support. This is a feature i was looking forward to. And couldn’t wait to give this a try. So when i got a email that the new beta is out. I didn’t wait and downloaded the behemoth.

Adding VMWare support to the IDE seems like a logical thing to do. Specially since everything is virtualized now a days. I thought about this a while. But you can use it in different setups. For me it is an extra on my development environment. I’m a big Linux enthusiast. But at the office i work on windows. So now i can develop in my own virtual Linux environment. But it’s also a great solution for running Unit Test on a production VM. Or just to test on a production VM.

My first try was on my OS of choice which is Ubuntu. That however didn’t go to well. As soon as i started the “Run as VMWare application” my IDE would die on me. I quickly gave up on this mainly because i am running Maverick which is not considered stable. And VMWare already had some problems building the kernel modules. If anybody is interested in the crash logs. I still have some.

So back to windows. Windows 7 in particular. I always keep a Windows partition laying around. For games and stuff. So i downloaded the following files.

* Ubuntu-Server
* Zend Studio 8 Beta (trial)
* VMWare 7.1.2 (trial)

Installing VMWare and Zend Studio is a since. Nothing to make note off here. After that was done i installed Ubuntu 10.04 Server edition. And installed Zend Server inside of it. That should be all.. right? So let’s launch the IDE and give it a shot. Well it launched but i got back an error like below.

At first i had no clue what was going on. But i had the feeling there was something wrong with the VMWare client tools. After digging through the Zend Studio manual i found the answer The ‘hgfs’ was not mounted on teh client OS. And this was because the vmware tools did not have enough libraries to build everything. To build the complete VMWare tools on the client OS we need

* gcc
* make
* build-essential
* linux-headers-(current version)

When that’s done it necessary to attach the linux version of the VMWare tools to the virtual CDRom drive. So we can mount it inside the VM.

/usr/lib/vmware/isoimages/linux.iso

mount /dev/cdrom /mnt

Copy the file somewhere and unmount the /mnt or the build will fail. Unpack the VMWare tools and run the perl script inside to install. Once that’s done follow the VMWare instructions. Or reboot the VM.

Now we are all set. Now it’s just a matter of writing code. And running it on the VM. When running an application as a VMWare application the IDE syncs the files with the shared folder on the VM. After that the internal browser is launched to see the result.

The first time you will be asked for the VM to use. Just point it to the VM image created by VMWare.

When no VM is active when launching the application. Zend Studio will trigger VMWare to launch the VM.

Some output in Zend Studio

Zend Studio Project Outline Missing

Project Outline is a superb feature of Zend Studio for navigating fast through your project and classes.
However once in a while a problem occurs with this project outline when checking out a new project from a SVN repository.

Normally you would browse your repository by using SVN Repositories in the Show View option under Window. Checking out the trunk with Find/Check Out As gives you the option to check out as a PHP Project. Which will enable your Project Outline.

However for some reason I could not get a specific project with the Projecet Outline. Then i checked the .project file created by Zend Studio and noticed 2 differenced.

First the buildspec tag was totally empty. Meaning Zend Studio would not use the Incremental Project Builder and not use the Validation Manager Wrapper. (Does nothing for your project outline)

Second was the natures tag. This tag was also empty. But should have got <nature>org.eclipse.php.core.PHPNature</nature> tag in it for Zend Studio to activate the Project Outline.

Enable XDebug in Zend Studio for Eclipse

I’m a great fan of the Zend Studio for Eclipse IDE. But there is one think that just didn’t feel right. At first i started out using the PDT. Free version of Zend Studio for Eclipse. In this IDE it was possible to switch debuggers. So you were not only forced to use the ZendDebugger. you could also choose to make use of the best debugger out there. XDebug. Although there is nothing wrong with the ZendDebugger. I just got used to XDebug.

So about an hour ago when i was reading my blog list i noticed a post from Max Horvath. In this post he explains how to enable the XDebugger in Zend Studio for Eclipse. Great news for a very slow monday morning. I will not copy his post so you can head over to Max’s Blog and read how to enable XDebug’s power.

Here is a document explaining how to enable XDebug in PDT: http://www.eclipse.org/pdt/documents/XDebugGuide.pdf

One small think i noticed though. Was that when i enabled XDebug according to Max’s post. After enabling it. I went to the Preferences > PHP > Debug tab and noticed there was no PHP Executable to select. So i headed over to the Preferences > PHP > PHP Executables and added a new PHP executable. This seemed to work.

Stop ACTA