Quick and small blog posts describing in steps how to get things done


Working on Sencha Command for Sencha Touch


Update June 26th 2012; This effort has been discontinued due to Sencha delivering the awesome Sencha SDK tools (http://www.sencha.com/products/sdk-tools/)


Since some time I’m working with Sencha Touch (ST) to create mobile projects. One of the hard parts of learning the MVC structure for ST is setting up the correct file and directory hierarchy.

Sencha Touch does contain a very cool tool to do this quick and clean, it is called Sencha Command. When I started playing with it I came across a few errors which made it almost impossible to decently work with it, but as a developer I’m not to lazy to get my hands dirty on some code.
I started my search on Github where I came across the master by Muc at https://github.com/muc/sencha-command I immediately forked it and started playing. This version of Sencha Command seemed to be quite clean and workable. The only thing that was still missing in creating the application skeletons was a folder for the stores part of the MVC framework. So I started working on my own fork and fixed this is my pull request. If you want the latest and greatest you can grab it from my own Github account https://github.com/Martin1982/sencha-command

Next stop will be the build command which isn’t quite working out for me as well. Don’t know when I will find time again for it though. If you’re looking for more Sencha Touch MVC resources I’d recommend watching this video:

SenchaCon 2010: Structuring Your Sencha Touch Application from Sencha on Vimeo.


Dutch PHP Conference 2011 (a.k.a. DPC 2011)


I’m already fully preparing my talk for the Dutch PHP Conference 2011, this time it is not directly quality related. This time we will learn how to take over the world with Zend Framework. Well probably the title is a bit over-done, but I like to do that. I’m going to try to squeeze into 45 minutes what Zend_Locale is and which other components are affected by using it. We will look at an example and at the moment I’m hacking away on some treats to even extend the functionality beyond it’s limits. All by using PHP and Zend Framework.

Although I’m not a Zend Framework guru like Rob Allen or Matthew Weier O’Phinney, I became a pretty heavy user of the package. Especially people who haven’t had the chance to look internationalization will catch up quite a few great tricks to finally make problems like translation and currencies (which are very common in multinational’s sites or webshops) a thing of the past.
Even if you have never used Zend Framework my session will get you up to speed quite fast. I’m now working on a demo project which I will put on Github after the DPC.


Speaking at the PHPBenelux Conference 2011


This year will start out with a bang, not only am I fortunate enough to help organizing the PHPBenelux conference, I will also fill up one of the slots with my talk on continuous integration. The talk originates as a quick unconference fillup which was created in 15 minutes during the Dutch PHP Conference, there the talk was well accepted and even gave me an assured spot for the 2011 edition.

A few months later I worked out the talk some more into what it actually should be and presented it at one of the user group meetings. Again there were almost no questions and everyone said it was pretty clear. You might ask yourself, how can you improve on that? Well I did some major continuous integration on my own talk. It already contained the basics, the common tools for a PHP environment, a single environment (CruiseControl + phpUnderControl).

So this time we’ll add a second environment (Hudson), there’s still time for that. The screenshots will be even more clear, so you won’t need to do much guessing on how to start when you finally do. And last but not least I can add a whole lot of real life experience tips as I have been growing into the subject more and more.

Why should you come and see my talk? If you haven’t heard of continuous integration you’ll get to know the matter. You will see how it will affect your development lifecycle to deliver more stable and changeable code. And how you can be assured that your changes won’t break other parts of your application. We also look into complexity of code, because we like to keep it simple, duplicate code, or very complex routines don’t help anyone.

So in the end I want you to leave the room with a feeling that you can finally keep control of that monstrous project that always bites you in the back when new customer requirements reach your desk.

Hope to see you all in Antwerp, if you haven’t bought your ticket yet you can do so in the shop


Quickly adding terms to a Zend_Translate array


A little while ago I ran into a task that was pretty repetitive, so I quickly coded a small solution which I’d like to share with you all.

I was working on making a site multilingual using Zend_Translate with the array adapter, I created my translation files with the returning array in the translations folder.

Now putting in all the translation terms and putting these in all the array variables for each language was pretty dull and time consuming. I wanted to have a tool which I could run from command line so I came up with the following;

isDot()) continue;     
$fileLocation = $fileInfo->getPathname();     
$fileContent = file_get_contents($fileLocation); $newContent = str_replace(');',"    '".$translateItem."' => '".$translateItem."',n);",$fileContent); file_put_contents($fileLocation, $newContent);

Now I can just call ./add-translation “welcome to my site” from the command line to get the new translations into each language file with a default value.

Hope this helps in your daily tasks, any comments are appreciated.

This article has been taken from my old blog, so it could look familiar. I’m closing down the old one and transfer the most interesting articles.

Deploying a Zend Framework application using git to a Plesk server


Most of you will tell me I’m insane that I am still running the plesk server, but actually I’m still quite happy with it. With common Linux knowledge it’s all really maintainable while having the easy interface to get things done.

Today the time had come to make a first test release of a Zend Framework application on my production server.
So here’s what I did;

  • Login to the server using SSH
  • Move to the domain directory where the httpdocs folder for my project resides
  • Moved the current directory for safe keeping; mv httpdocs httpdocs_backup
  • Made a clone of my repository contents; git clone /my/git/repository destination
  • Created a symbolic link for httpdocs: ln -s destination/public httpdocs
  • Gave Plesk the rights to access the httpdocs; chown -h username:psaserv httpdocs
    If you don’t know the username check it using ls -las
  • Gave Plesk the rights to access the public folder of my application: chown -R username:psaserv release-001/public

And that’s it, deployment succeeded.
Always keep in mind to setup your application.ini with the correct settings, but this is not different from a normal deployment.

Go to Top